Skip to main content
 
developerworks > Community >  Dashboard > WebSphere eXtreme Scale V6.1 User Guide > ... > ObjectGrid 6.1 cumulative fix 3 contents > LogElement.beforeImage() method returns the wrong value
developerWorks
Log In   View a printable version of the current page.
Overview New to Forums Wikis
LogElement.beforeImage() method returns the wrong value
Added by jhanders, last edited by Chris.D.Johnson on Dec 18, 2007  (view change)
Labels: 
(None)

Getting Started Examples Reference API documentation
See the WebSphere eXtreme Scale Wiki for links to up-to-date eXtreme Scale Version 7.x documentation.

If you log in with your developerWorks ID, you can leave comments and feedback for the development team.

Component ObjectGrid Core API
Software Version 6.1

Problem

The getBeforeImage method of the LogElement interface returns a wrong value, resulting in a ClassCastException exception.

The getBeforeImage() method on the LogElement interface can incorrectly return a CacheEntry instead of the stored Object type. This behavior can result in a ClassCastException exception when casting the getBeforeImage() return value to your value type.

Cause

For certain LogElement types, a CacheEntry instance was returned instead of the Object type that was stored.

Workaround

Check to see if the Object that is returned from the getBeforeImage() method is an instance of CacheEntry. Cast the Object returned to CacheEntry and call the CacheEntry.getCommittedValue() method to get the Object with the correct class type.

Solution

Apply ObjectGrid cumulative intermediate fix 3.

Wiki Disclaimer and License
© Copyright IBM Corporation 2007,2010. All Rights Reserved.