openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r1308184 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransState.java
Date Sun, 01 Apr 2012 19:41:00 GMT
Author: curtisr7
Date: Sun Apr  1 19:40:59 2012
New Revision: 1308184

URL: http://svn.apache.org/viewvc?rev=1308184&view=rev
Log:
OPENJPA-2151: If transitioning from PClean to PNonTransState, don't reset dirty bitset.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransState.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransState.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransState.java?rev=1308184&r1=1308183&r2=1308184&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransState.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PNonTransState.java
Sun Apr  1 19:40:59 2012
@@ -40,12 +40,13 @@ class PNonTransState
     @Override
     void initialize(StateManagerImpl context, PCState previous) {
         if (previous == null)
-            return;
-        
-        // spec says all proxies to second class objects should be reset
-        context.proxyFields(true, false);
-
-        context.setDirty(false);
+         return;
+        // If our previous state is clean, we don't need to do any sort of cleanup
+        if (previous != PCLEAN) {
+            // spec says all proxies to second class objects should be reset
+            context.proxyFields(true, false);
+            context.setDirty(false);
+        }
         context.clearSavedFields();
     }
 



Mime
View raw message