users@glassfish.java.net

Re: EntityManager's forced version update (lock(WRITE) + flush()) not atomi

From: <glassfish_at_javadesktop.org>
Date: Fri, 14 Nov 2008 12:48:05 PST

I understand that optimistic locking compares the the version number in the managed entity to the one in the database. After the lock(write) previously called, the version is forced in the entity from n to n+1. So whehn flushing, the current version is n+1, not n.
If it were not for the lock(write) i agree is would be still n.

I am wrong?
[Message sent by forum member 'vladbalan' (vladbalan)]

http://forums.java.net/jive/thread.jspa?messageID=316852