HHH-6897 fix for 'registry contains more than one (2) entity manager factories: EMF_BaseEntityManagerFunctionalTestCase' failure
This commit is contained in:
parent
40c61775df
commit
5e3775afe8
|
@ -195,11 +195,14 @@ public abstract class BaseEntityManagerFunctionalTestCase extends BaseUnitTestCa
|
||||||
@After
|
@After
|
||||||
@SuppressWarnings( {"UnusedDeclaration"})
|
@SuppressWarnings( {"UnusedDeclaration"})
|
||||||
public void releaseResources() {
|
public void releaseResources() {
|
||||||
|
try {
|
||||||
releaseUnclosedEntityManagers();
|
releaseUnclosedEntityManagers();
|
||||||
|
}
|
||||||
if ( entityManagerFactory != null ) {
|
finally {
|
||||||
|
if ( entityManagerFactory != null && entityManagerFactory.isOpen()) {
|
||||||
entityManagerFactory.close();
|
entityManagerFactory.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Note we don't destroy the service registry as we are not the ones creating it
|
// Note we don't destroy the service registry as we are not the ones creating it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue