|Getting OptimisticLockException on new Entity [message #535847]
||Wed, 26 May 2010 01:12
| Will Hartung
Registered: March 2010
I'm creating an entity.|
It is MOSTLY all new (no primary key), however there are some child elements that are not new, they're existing, persisted objects.
When I try and save the object using EntityManager.merge, I get:
Caused by: Exception [EclipseLink-5010] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.OptimisticLockException
Exception Description: The object [entities.Task@0] cannot be merged because it has changed or been deleted since it was last read.
Task itself is the new object, and none of the children objects are changed during this process.
I have logging set to FINE, but see no DB activity at this point.
I've checked all my sequences, and it doesn't look like I'm trying to reuse a sequence number (i.e. my new sequence results in a key that already exists in the DB).
Any thoughts appreciated.
[Updated on: Wed, 26 May 2010 01:12]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02055 seconds