HHH-6792 connection leaks due to service registry is not destroyed
This commit is contained in:
parent
192682d31b
commit
70bd57bcff
|
@ -229,7 +229,7 @@ public class JdbcServicesImpl implements JdbcServices, ServiceRegistryAwareServi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void releaseConnection(Connection connection) throws SQLException {
|
public void releaseConnection(Connection connection) throws SQLException {
|
||||||
connection.close();
|
connectionProvider.closeConnection( connection );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ public class JdbcServicesImpl implements JdbcServices, ServiceRegistryAwareServi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void releaseConnection(Connection connection) throws SQLException {
|
public void releaseConnection(Connection connection) throws SQLException {
|
||||||
connection.close();
|
connectionProvider.releaseAnyConnection( connection );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -252,7 +252,7 @@ public abstract class AbstractServiceRegistryImpl implements ServiceRegistryImpl
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
ListIterator<Service> serviceIterator = serviceList.listIterator( serviceList.size() );
|
ListIterator<Service> serviceIterator = serviceList.listIterator( serviceList.size() );
|
||||||
while ( serviceIterator.hasPrevious() ) {
|
while ( serviceIterator.hasPrevious() ) {
|
||||||
|
|
|
@ -365,6 +365,11 @@ public abstract class BaseCoreFunctionalTestCase extends BaseUnitTestCase {
|
||||||
sessionFactory.close();
|
sessionFactory.close();
|
||||||
sessionFactory = null;
|
sessionFactory = null;
|
||||||
configuration = null;
|
configuration = null;
|
||||||
|
if(serviceRegistry == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
serviceRegistry.destroy();
|
||||||
|
serviceRegistry=null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnFailure
|
@OnFailure
|
||||||
|
|
Loading…
Reference in New Issue