We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40c6177 commit 5e3775aCopy full SHA for 5e3775a
hibernate-entitymanager/src/test/java/org/hibernate/ejb/test/BaseEntityManagerFunctionalTestCase.java
@@ -195,10 +195,13 @@ protected boolean createSchema() {
195
@After
196
@SuppressWarnings( {"UnusedDeclaration"})
197
public void releaseResources() {
198
- releaseUnclosedEntityManagers();
199
-
200
- if ( entityManagerFactory != null ) {
201
- entityManagerFactory.close();
+ try {
+ releaseUnclosedEntityManagers();
+ }
+ finally {
202
+ if ( entityManagerFactory != null && entityManagerFactory.isOpen()) {
203
+ entityManagerFactory.close();
204
205
}
206
// Note we don't destroy the service registry as we are not the ones creating it
207
0 commit comments