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:20:17 PST

Marina and Gili,

thanks for your post. As i said in a previous post, i knew already that READ_COMMITED is assumed by JPA.

BUT then: dirty reads are prevented by default without need for calling lock(). The javadoc should be updated to eliminate the phrase who states that it ensures no dirty-reads take place. It has nothing to do with it. Not to say that lock() may not even get the chance to be called before T2 (the one assumed to be doing a dirty read) commits (see my scenario).

Waiting for your opinion.
[Message sent by forum member 'vladbalan' (vladbalan)]

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