aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eji...@apache.org
Subject svn commit: r1360099 - in /aries/trunk/jpa/jpa-container/src: main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java test/java/org/apache/aries/jpa/container/PersistenceBundleLifecycleTest.java
Date Wed, 11 Jul 2012 10:20:03 GMT
Author: ejiang
Date: Wed Jul 11 10:20:02 2012
New Revision: 1360099

URL: http://svn.apache.org/viewvc?rev=1360099&view=rev
Log:
ARIES-832: JPA load-time enhamcement fails for a WAB - revert 1297497 as the 1st patch caused
jpa load time enhancing unreliable for earlier version of osgi runtime since the entity manager
was created too late. Brian will come up with a different fix for his problem or try out Tim's
suggestion.

Modified:
    aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
    aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/PersistenceBundleLifecycleTest.java

Modified: aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java?rev=1360099&r1=1360098&r2=1360099&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
(original)
+++ aries/trunk/jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/impl/EntityManagerFactoryManager.java
Wed Jul 11 10:20:02 2012
@@ -25,8 +25,8 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Set;
+import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
@@ -171,11 +171,11 @@ public class EntityManagerFactoryManager
         //If we are Resolved as a result of having stopped
         //and missed the STOPPING event we need to unregister
         unregisterEntityManagerFactories();
+      //Create the EMF objects if necessary
+        createEntityManagerFactories();
         break;
         //Starting and active both require EMFs to be registered
       case Bundle.STARTING :
-        //Create the EMF objects if necessary
-        createEntityManagerFactories();
       case Bundle.ACTIVE :
         if(tracker == null) {
           tracker = new ServiceTracker(bundle.getBundleContext(), 

Modified: aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/PersistenceBundleLifecycleTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/PersistenceBundleLifecycleTest.java?rev=1360099&r1=1360098&r2=1360099&view=diff
==============================================================================
--- aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/PersistenceBundleLifecycleTest.java
(original)
+++ aries/trunk/jpa/jpa-container/src/test/java/org/apache/aries/jpa/container/PersistenceBundleLifecycleTest.java
Wed Jul 11 10:20:02 2012
@@ -406,6 +406,7 @@ public class PersistenceBundleLifecycleT
     //Now try Resolving
     Skeleton.getSkeleton(persistenceBundle).setReturnValue(new MethodCall(Bundle.class, "getState"),
Bundle.RESOLVED);
     mgr.modifiedBundle(persistenceBundle, new BundleEvent(BundleEvent.RESOLVED, persistenceBundle),
o);
+    testSuccessfulCreationEvent(ref, extenderContext, 1);
     BundleContextMock.assertNoServiceExists(EntityManagerFactory.class.getName());
     
     
@@ -487,6 +488,7 @@ public class PersistenceBundleLifecycleT
     mgr.modifiedBundle(persistenceBundle, new BundleEvent(BundleEvent.RESOLVED, persistenceBundle),
getTrackedObject());
     
     //We will have created the EMF a total of 2 times
+    testSuccessfulCreationEvent(ref, extenderContext, 2);
     BundleContextMock.assertNoServiceExists(EntityManagerFactory.class.getName());
   }
   



Mime
View raw message