diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java index 0adcd4546..edbee2b6d 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java @@ -71,7 +71,7 @@ public class OpenJPAConfigurationImpl // openjpa properties public ObjectValue classResolverPlugin; - public BrokerValue brokerPlugin; + public ObjectValue brokerPlugin; public ObjectValue dataCachePlugin; public ObjectValue dataCacheManagerPlugin; public IntValue dataCacheTimeout; diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java index ccca49230..a0fa1032f 100644 --- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java +++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java @@ -83,15 +83,6 @@ public class PersistenceProviderImpl 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; @@ -102,6 +93,15 @@ public class PersistenceProviderImpl 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()); return OpenJPAPersistence.toEntityManagerFactory(factory);