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.
© Copyright IBM Corporation 2007,2010. All Rights Reserved.