mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-10 13:14:50 +00:00
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,10 +195,13 @@ protected boolean createSchema() {
|
||||
@After
|
||||
@SuppressWarnings( {"UnusedDeclaration"})
|
||||
public void releaseResources() {
|
||||
releaseUnclosedEntityManagers();
|
||||
|
||||
if ( entityManagerFactory != null ) {
|
||||
entityManagerFactory.close();
|
||||
try {
|
||||
releaseUnclosedEntityManagers();
|
||||
}
|
||||
finally {
|
||||
if ( entityManagerFactory != null && entityManagerFactory.isOpen()) {
|
||||
entityManagerFactory.close();
|
||||
}
|
||||
}
|
||||
// Note we don't destroy the service registry as we are not the ones creating it
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user