users@glassfish.java.net

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

From: <glassfish_at_javadesktop.org>
Date: Mon, 10 Nov 2008 11:57:33 PST

If this is the case and given that JPA assumes READ_COMMITED as for its specification (!) 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.

Someone should inform them.
[Message sent by forum member 'vladbalan' (vladbalan)]

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