You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by cu...@apache.org on 2010/04/21 20:48:30 UTC
svn commit: r936436 -
/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_runtime.xml
Author: curtisr7
Date: Wed Apr 21 18:48:29 2010
New Revision: 936436
URL: http://svn.apache.org/viewvc?rev=936436&view=rev
Log:
OPENJPA-1604: Doc update.
Modified:
openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_runtime.xml
Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_runtime.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_runtime.xml?rev=936436&r1=936435&r2=936436&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_runtime.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_runtime.xml Wed Apr 21 18:48:29 2010
@@ -936,6 +936,24 @@ state in question to circumvent the data
from issuing a locking SELECT in the first place.
</para>
</listitem>
+ <listitem>
+ <para>
+When using the pessimistic lock manager and named queries you will see the following
+<literal>WARNING</literal> message logged if you do not specify a lockMode on the named query
+or you explicitly set it to <literal>LockModeType.NONE</literal>. When using the pessimistic
+lock manager a <literal>LockModeType.NONE</literal> will always be promoted to <literal>LockModeType.READ</literal>.
+<programlisting>
+WARN [main] openjpa.MetaData - Encountered a read lock level less than LockModeType.READ when processing the NamedQuery annotation "findEmployeeById" in class "org.apache.openjpa.persistence.lockmgr.LockEmployee". Setting query lock level to LockModeType.READ.
+</programlisting>
+If you are using the pessimistic lock manager and you truly do want to set the lock mode to NONE for a
+given query, you can use a fetch plan to do so.
+<programlisting>
+OpenJPAQuery q = em.createNamedQuery("findEmployeeById");
+FetchPlan fp = q.getFetchPlan();
+fp.setReadLockMode(LockModeType.NONE);
+</programlisting>
+ </para>
+ </listitem>
</itemizedlist>
</section>
</section>