Skip to main content
 
developerworks > Community >  Dashboard > WebSphere eXtreme Scale V6.1 User Guide > ... > ObjectGrid 6.1 cumulative fix 3 contents > Entity optimistic lock fails to detect version changes
developerWorks
Log In   View a printable version of the current page.
Overview New to Forums Wikis
Entity optimistic lock fails to detect version changes
Added by Chris.D.Johnson, 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 EntityManager API
Software Version 6.1

Problem

Optimistic locking might fail to detect a collision or might incorrectly display an OptimisticCollisionException exception.

You might encounter the following problems when you are using the Optimistic LockStrategy with entity maps:

  • When using @Version fields, the entity instance does not reflect the version change when the transaction is flushed. Because the version is not correctly incremented, a collision might not be detected.
  • When a @Version field is not used with an entity subset, an OptimisticCollisionException exception always results when the transaction is committed.

Cause

The ObjectGrid is not correctly reflecting the version into the entity object instance and is not correctly comparing subset tuples.

Workaround

Always to use a @Version field. Using this field can prevent costly copy and compare operations when detecting collisions. To avoid this problem, do not use subset entities. Use entities that have the same class definition and name as the entities on the server.

Solution

Apply ObjectGrid cumulative intermediate fix 3.

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