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 11:54:00 PST

Marina, if T1's commit takes place between the lock and the flush of T2, then, clearly T1 commits succesfully and increments the version to, say, n+1.
After this, at T2's flush point, T2's cached version is also n+1 after the previous increment triggered by lock(). So the flush is allowed, as it is the same version n+1 as in the database.

Then T2 continues and commits succesfully.

Would like to know your opinion on this. Thanks.
[Message sent by forum member 'vladbalan' (vladbalan)]

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