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 16:08:29 PST

may be my browser doesn't display your example correctly, but if you call em.lock() in tx1 *after* tx2 has committed, nothing will change. Look at the slides 36-43 from this JavaONE presentation: http://developers.sun.com/learning/javaoneonline/2007/pdf/TS-4902.pdf to understand how the locks are expected to work.

Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

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