You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by mt...@apache.org on 2011/04/25 09:49:27 UTC
svn commit: r1096425 -
/openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_em.xml
Author: mtylenda
Date: Mon Apr 25 07:49:27 2011
New Revision: 1096425
URL: http://svn.apache.org/viewvc?rev=1096425&view=rev
Log:
OPENJPA-1932: Documentation update: Add information about other lock-related methods to the entity locking section.
Modified:
openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_em.xml
Modified: openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_em.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_em.xml?rev=1096425&r1=1096424&r2=1096425&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_em.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_em.xml Mon Apr 25 07:49:27 2011
@@ -84,6 +84,11 @@ Cache management.
</listitem>
<listitem>
<para>
+Entity locking.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
Closing.
</para>
</listitem>
@@ -990,6 +995,10 @@ native query support.
locking
</secondary>
</indexterm>
+ <para>
+In the area of concurrency control, the JPA specification supports
+optimistic and pessimistic locking.
+ </para>
<programlisting>
public void lock(Object entity, LockModeType mode);
</programlisting>
@@ -1064,6 +1073,20 @@ will be incremented even if the entity's
</para>
</listitem>
</itemizedlist>
+ <para>
+Entities can also be locked at the time when entity state gets loaded from the datastore.
+This is achieved by supplying a lock mode to the respective versions of
+<methodname>find</methodname> and <methodname>refresh</methodname> methods.
+If an entity state is to be loaded by a query, a lock mode can be passed to the
+<methodname>Query.setLockMode</methodname> and <methodname>TypedQuery.setLockMode</methodname>
+methods.
+ </para>
+<programlisting>
+public LockModeType getLockMode(Object entity);
+</programlisting>
+ <para>
+Returns the lock mode currently held by the given entity.
+ </para>
<note>
<itemizedlist>
<listitem>