HHH-6897 fix for 'registry contains more than one (2) entity manager factories: EMF_BaseEntityManagerFunctionalTestCase' failure

This commit is contained in:
Scott Marlow 2012-01-04 13:27:12 -05:00
parent 40c61775df
commit 5e3775afe8
1 changed files with 7 additions and 4 deletions

View File

@ -195,11 +195,14 @@ public abstract class BaseEntityManagerFunctionalTestCase extends BaseUnitTestCa
@After
@SuppressWarnings( {"UnusedDeclaration"})
public void releaseResources() {
try {
releaseUnclosedEntityManagers();
if ( entityManagerFactory != null ) {
}
finally {
if ( entityManagerFactory != null && entityManagerFactory.isOpen()) {
entityManagerFactory.close();
}
}
// Note we don't destroy the service registry as we are not the ones creating it
}