openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r513974 - in /incubator/openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java
Date Fri, 02 Mar 2007 21:57:04 GMT
Author: awhite
Date: Fri Mar  2 13:57:03 2007
New Revision: 513974

URL: http://svn.apache.org/viewvc?view=rev&rev=513974
Log:
Fix a couple of errors in the code to default to the non-finalizing broker
in PersistenceProviderImpl.createContainerManagedEntityManagerFactory:
  1) Don't add to the given Map, because it might be read-only.  
  2) Prefix the BrokerImpl property correctly when adding it.


Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
    incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java?view=diff&rev=513974&r1=513973&r2=513974
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java
Fri Mar  2 13:57:03 2007
@@ -71,7 +71,7 @@
 
     // openjpa properties
     public ObjectValue classResolverPlugin;
-    public BrokerValue brokerPlugin;
+    public ObjectValue brokerPlugin;
     public ObjectValue dataCachePlugin;
     public ObjectValue dataCacheManagerPlugin;
     public IntValue dataCacheTimeout;

Modified: incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java?view=diff&rev=513974&r1=513973&r2=513974
==============================================================================
--- incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java
(original)
+++ incubator/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java
Fri Mar  2 13:57:03 2007
@@ -83,15 +83,6 @@
         PersistenceUnitInfo pui, Map m) {
         PersistenceProductDerivation pd = new PersistenceProductDerivation();
         try {
-            // if the BrokerImpl hasn't been specified, switch to the
-            // non-finalizing one, since anything claiming to be a container
-            // should be doing proper resource management.
-            if (!Configurations.containsProperty(BrokerValue.KEY,
-                pui.getProperties())
-                && !Configurations.containsProperty(BrokerValue.KEY, m)) {
-                m.put(BrokerValue.KEY, BrokerValue.NON_FINALIZING_ALIAS);
-            }
-
             ConfigurationProvider cp = pd.load(pui, m);
             if (cp == null)
                 return null;
@@ -101,6 +92,15 @@
                 (CLASS_TRANSFORMER_OPTIONS, pui.getProperties());
             pui.addTransformer(new ClassTransformerImpl(cp, ctOpts, 
                 pui.getNewTempClassLoader()));
+
+            // if the BrokerImpl hasn't been specified, switch to the
+            // non-finalizing one, since anything claiming to be a container
+            // should be doing proper resource management.
+            if (!Configurations.containsProperty(BrokerValue.KEY,
+                cp.getProperties())) {
+                cp.addProperty("openjpa." + BrokerValue.KEY, 
+                    BrokerValue.NON_FINALIZING_ALIAS);
+            }
 
             BrokerFactory factory = Bootstrap.newBrokerFactory(cp, 
                 pui.getClassLoader());



Mime
View raw message