users@glassfish.java.net

Re: How does an explicit EntityManager.lock() call prevent dirty reads in J

From: <glassfish_at_javadesktop.org>
Date: Tue, 11 Nov 2008 23:30:16 PST

Marina,

I have read the slides. As expected, it is about preventing lost-updates. Not dirty-reading as per the definition stated in the javadoc of LockModeType. There it says about T2 reading an updated but not commited value of T1 and T2 commiting succesfully.

But if you're under READ_COMMITED this never happens anyway. So lock() has no contribution here.

Pls give your opinion.
[Message sent by forum member 'vladbalan' (vladbalan)]

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