Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Unexpected OptimisticLockException on merge()

Hello,

When merging an instance within my program a OptimisticLockException is thrown, although there's
no one else accessing neither the database nor the record updated by the program:

Exception Description: The object [net.uniopt.domain.ot.Depot@ffae4c] cannot be merged because
it has changed or been deleted since it was last read.
Class> net.uniopt.domain.ot.Depot
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.mergeInternal
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.merge

I guess the exception is thrown because there's already a managed instance (the one that was
returned by merge() and updated) and now I again try to merge an unmerged instance with the same
id.

Might this be the reason for the exception?
If not, what might cause this behaviour?

- Michael


Back to the top