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 09:56:12 PST

You are right this is all very confusing.

Looking at http://java.sun.com/javaee/5/docs/api/javax/persistence/LockModeType.html

1) By definition, P1 is impossible under READ_COMMITTED regardless of what JPA does. I'm not sure how one would go about implementing this without READ_COMMITTED...

2) P2 doesn't indicate whether T2 commits before T1 but as far as I can tell it has to, because there is no way of causing T1's commit to fail otherwise.
[Message sent by forum member 'cowwoc' (cowwoc)]

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