openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r1458432 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
Date Tue, 19 Mar 2013 17:55:17 GMT
Author: curtisr7
Date: Tue Mar 19 17:55:17 2013
New Revision: 1458432

URL: http://svn.apache.org/r1458432
Log:
OPENJPA-2353: Fix bug in BrokerImpl.initializeOperatingSet() initialization after deserialization.

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

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=1458432&r1=1458431&r2=1458432&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Tue
Mar 19 17:55:17 2013
@@ -196,8 +196,8 @@ public class BrokerImpl implements Broke
 
     // these are used for method-internal state only
     private transient Map<Object, StateManagerImpl> _loading = null;
-    private transient Set<Object> _operating = MapBackedSet.decorate(new IdentityHashMap<Object,
Object>());;
-    private transient boolean _operatingDirty = false;
+    private transient Set<Object> _operating = null;
+    private transient boolean _operatingDirty = true;
 
     private Set<Class<?>> _persistedClss = null;
     private Set<Class<?>> _updatedClss = null;
@@ -342,7 +342,10 @@ public class BrokerImpl implements Broke
         _log = _conf.getLog(OpenJPAConfiguration.LOG_RUNTIME);
         if (!fromDeserialization)
             _cache = new ManagedCache(this);
+        // Force creation of a new operating set
+        _operatingDirty = true;
         initializeOperatingSet();
+        
         _connRetainMode = connMode;
         _managed = managed;
         if (managed)
@@ -4790,6 +4793,10 @@ public class BrokerImpl implements Broke
         // re-initialize the lock if needed.
         setMultithreaded(_multithreaded);
 
+        // force recreation of set
+        _operatingDirty = true;
+        initializeOperatingSet();
+
         if (isActive() && _runtime instanceof LocalManagedRuntime)
             ((LocalManagedRuntime) _runtime).begin();
     }
@@ -5243,6 +5250,13 @@ public class BrokerImpl implements Broke
     
     private boolean operatingAdd(Object o){
         _operatingDirty = true;
+        try {
         return _operating.add(o);
+        }catch(NullPointerException npe){
+            System.out.print(false);
+        }
+        
+        return false;
     }
+    
 }



Mime
View raw message