incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From timothyjw...@apache.org
Subject svn commit: r911525 - /incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
Date Thu, 18 Feb 2010 18:51:01 GMT
Author: timothyjward
Date: Thu Feb 18 18:51:01 2010
New Revision: 911525

URL: http://svn.apache.org/viewvc?rev=911525&view=rev
Log:
ARIES-137 : Eliminate ordering restriction in PersistenceBundleManager - PersistenceProviders
can be registered after Persistence bundles are installed

Modified:
    incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java

Modified: incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java?rev=911525&r1=911524&r2=911525&view=diff
==============================================================================
--- incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
(original)
+++ incubator/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/PersistenceBundleManager.java
Thu Feb 18 18:51:01 2010
@@ -171,11 +171,9 @@
         mgr.destroy();
         if(infos != null)
           persistenceUnitFactory.destroyPersistenceBundle(mgr.getBundle());
-        //Put the manager into the list of managers waiting for a new
-        //provider, one that might work!
-        synchronized (this) {
-          managersAwaitingProviders.add(mgr);
-        }
+        
+        //Something better may have come along while we weren't synchronized
+        setupManager(mgr.getBundle(), mgr, false);
       }
     }
   }
@@ -250,7 +248,15 @@
       setupManager(bundle, mgr, true);
     } else {
       try {
-        mgr.bundleStateChange();
+        boolean reassign;
+        synchronized (this) {
+          reassign = managersAwaitingProviders.contains(mgr);
+        }
+        if(reassign) {
+          setupManager(bundle, mgr, false);
+        } else {
+          mgr.bundleStateChange();
+        }
       } catch (InvalidPersistenceUnitException e) {
         logInvalidPersistenceUnitException(bundle, e);
         mgr.destroy();



Mime
View raw message