openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r1202800 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java openjpa-project/src/doc/manual/migration_considerations.xml
Date Wed, 16 Nov 2011 17:30:19 GMT
Author: curtisr7
Date: Wed Nov 16 17:30:19 2011
New Revision: 1202800

URL: http://svn.apache.org/viewvc?rev=1202800&view=rev
Log:
OPENJPA-1986: Update migration consideration docs and Compatibility javadoc.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java
    openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java?rev=1202800&r1=1202799&r2=1202800&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/Compatibility.java
Wed Nov 16 17:30:19 2011
@@ -558,7 +558,7 @@ public class Compatibility {
      * only applies for the case where we are trying to cascade a persist to an Entity which
doesn't have a StateManager
      * and we can't determine if it is detached. 
      *   
-     * @since 2.1.x
+     * @since 2.1.1
      */
     public boolean getCheckDatabaseForCascadePersistToDetachedEntity(){
         return _checkDatabaseForCascadePersistToDetachedEntity;
@@ -569,7 +569,7 @@ public class Compatibility {
      * only applies for the case where we are trying to cascade a persist to an Entity which
doesn't have a StateManager
      * and we can't determine if it is detached. 
      *   
-     * @since 2.1.x
+     * @since 2.1.1
      */
     public void setCheckDatabaseForCascadePersistToDetachedEntity(boolean b){
         _checkDatabaseForCascadePersistToDetachedEntity = b;

Modified: openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml?rev=1202800&r1=1202799&r2=1202800&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/migration_considerations.xml Wed Nov 16 17:30:19
2011
@@ -458,6 +458,25 @@
                     <xref linkend="jpa_2.2_allocationSize"/>.
                 </para>
             </section>            
+        	<section id="jpa_2.2_cascadePersist">
+                <title>
+                    Cascade persist behavior
+                </title>
+                <!-- See OPENJPA-1986 for details. -->
+				<para>
+					In previous releases, OpenJPA would check the database for the
+					existence of the related Entity before persisting the relationship to
+					that Entity. This resulted in an extra Select being sent to the
+					database. In 2.2.0, code was added so that when cascading a persist to
+					a related Entity without persistence state, the persist (insert) will
+					happen without first checking the database. This may result in an
+					EntityExistsException if the related Entity already exists in the
+					database. To revert this behavior to the previous release, set the
+					value of the <literal>openjpa.Compatibility</literal>
+					property <literal>CheckDatabaseForCascadePersistToDetachedEntity</literal>
+					to <literal>true</literal>.
+				</para>
+            </section>
         </section>
     </section>
 </appendix>



Mime
View raw message