Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] [ClassName] cannot be merged because it has changed or been deleted since it was last read

Hi,

I retrieve an Entity from the DB, modify it then invoke
EntityManager.merge() on it. For some reason EclipseLink throws this
exception:

javax.persistence.OptimisticLockException: Exception [EclipseLink-5010]
(Eclipse Persistence Services - 1.0 (Build 1.0 - 20080707)):
org.eclipse.persistence.exceptions.OptimisticLockException
Exception Description: The object [Object.toString() goes here] cannot be
merged because it has changed or been deleted since it was last read.
{3}Class> [className goes here]

I'm confused. Isn't the entire point of EntityManager.merge() to push
changes from the in-memory entity back to the database? Shouldn't this work?

Thank you,
Gili
-- 
View this message in context: http://www.nabble.com/-ClassName--cannot-be-merged-because-it-has-changed-or-been-deleted-since-it-was-last-read-tp19465366p19465366.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top