mirror of
https://github.com/apache/openjpa.git
synced 2025-02-21 01:15:30 +00:00
OPENJPA-1076 cleanup code formatting and add some comments about the current behavior of returning exceptions instead of null
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@798616 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a31b0ee95d
commit
b7b0b15777
@ -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 -->
|
||||
|
@ -88,24 +88,31 @@ public class PersistenceProviderImpl
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user