You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by dw...@apache.org on 2009/07/28 19:42:47 UTC
svn commit: r798616 - in /openjpa/trunk: openjpa-persistence-jdbc/pom.xml
openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java
Author: dwoods
Date: Tue Jul 28 17:42:47 2009
New Revision: 798616
URL: http://svn.apache.org/viewvc?rev=798616&view=rev
Log:
OPENJPA-1076 cleanup code formatting and add some comments about the current behavior of returning exceptions instead of null
Modified:
openjpa/trunk/openjpa-persistence-jdbc/pom.xml
openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java
Modified: openjpa/trunk/openjpa-persistence-jdbc/pom.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/pom.xml?rev=798616&r1=798615&r2=798616&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/pom.xml (original)
+++ openjpa/trunk/openjpa-persistence-jdbc/pom.xml Tue Jul 28 17:42:47 2009
@@ -805,8 +805,8 @@
<!-- TestPMMemory creates heapdumps etc and there's no real asserts within the test. -->
<exclude>org/apache/openjpa/persistence/kernel/TestPMMemory.java</exclude>
<!-- You can exclude the lockmgr test to save ~15 mins.
- <exclude>org/apache/openjpa/persistence/lockmgr/*.java</exclude>
-->
+ <exclude>org/apache/openjpa/persistence/lockmgr/*.java</exclude>
<!-- ================================================================== -->
<!-- Critera & MetaModel tests are *temporarily* excluded to wait for -->
<!-- spec to stabilize on Result Processing API -->
Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java?rev=798616&r1=798615&r2=798616&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java (original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProviderImpl.java Tue Jul 28 17:42:47 2009
@@ -88,24 +88,31 @@
try {
Object poolValue = Configurations.removeProperty(EMF_POOL, m);
ConfigurationProvider cp = pd.load(resource, name, m);
- if (cp == null)
+ if (cp == null) {
return null;
+ }
BrokerFactory factory = getBrokerFactory(cp, poolValue, null);
OpenJPAConfiguration conf = factory.getConfiguration();
_log = conf.getLog(OpenJPAConfiguration.LOG_RUNTIME);
- if(pd.checkPuNameCollisions(_log,name)==true){
+ if(pd.checkPuNameCollisions(_log,name)==true) {
;//return null;
}
+
loadAgent(_log, conf);
+
// TODO - Can this be moved back to BrokerImpl.initialize()?
// Create appropriate LifecycleEventManager
loadValidator(_log, conf);
+
return JPAFacadeHelper.toEntityManagerFactory(factory);
} catch (Exception e) {
_log.error(_loc.get("create-emf-error", name), e);
- throw PersistenceExceptions.toPersistenceException(e);
- //return null;
+ /*
+ * Maintain 1.x behavior of throwing exceptions, even though
+ * JPA2 9.2 - createEMF "must" return null for PU it can't handle
+ */
+ throw PersistenceExceptions.toPersistenceException(e);
}
}