HHH-16150 Fix a little issue with SessionFactoryImpl#disintegrate
This commit is contained in:
parent
97d5057751
commit
1a9f545e79
|
@ -371,7 +371,7 @@ public class SessionFactoryImpl extends QueryParameterBindingTypeResolverImpl im
|
|||
|
||||
}
|
||||
catch ( Exception e ) {
|
||||
disintegrate( integratorObserver );
|
||||
disintegrate( e, integratorObserver );
|
||||
|
||||
try {
|
||||
close();
|
||||
|
@ -453,11 +453,16 @@ public class SessionFactoryImpl extends QueryParameterBindingTypeResolverImpl im
|
|||
}
|
||||
}
|
||||
|
||||
private void disintegrate(IntegratorObserver integratorObserver) {
|
||||
for ( Integrator integrator : serviceRegistry.getService( IntegratorService.class ).getIntegrators() ) {
|
||||
private void disintegrate(Exception startupException, IntegratorObserver integratorObserver) {
|
||||
for ( Integrator integrator : integratorObserver.integrators ) {
|
||||
try {
|
||||
integrator.disintegrate( this, serviceRegistry );
|
||||
integratorObserver.integrators.remove( integrator );
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
startupException.addSuppressed( ex );
|
||||
}
|
||||
}
|
||||
integratorObserver.integrators.clear();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue