From bfd63f1fec7686ee6bed45063be2e1cc44993631 Mon Sep 17 00:00:00 2001 From: Brett Meyer Date: Mon, 10 Feb 2014 13:56:11 -0500 Subject: [PATCH] HHH-8930 corrected overzealous commit --- .../testing/junit4/BaseCoreFunctionalTestCase.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseCoreFunctionalTestCase.java b/hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseCoreFunctionalTestCase.java index e7513641f2..b671f24dbf 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseCoreFunctionalTestCase.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseCoreFunctionalTestCase.java @@ -379,7 +379,6 @@ public abstract class BaseCoreFunctionalTestCase extends BaseUnitTestCase { } sessionFactory.close(); sessionFactory = null; - configuration = null; if(serviceRegistry == null){ return; } @@ -392,20 +391,12 @@ public abstract class BaseCoreFunctionalTestCase extends BaseUnitTestCase { @SuppressWarnings( {"UnusedDeclaration"}) public void onFailure() { if ( rebuildSessionFactoryOnError() ) { + releaseSessionFactory(); rebuildSessionFactory(); } } protected void rebuildSessionFactory() { - if ( sessionFactory == null ) { - return; - } - sessionFactory.close(); - sessionFactory = null; - configuration = null; - serviceRegistry.destroy(); - serviceRegistry = null; - serviceRegistry = buildServiceRegistry( configuration ); if ( isMetadataUsed ) { // need to rebuild metadata because serviceRegistry was recreated