HHH-16911 Ensure we don't leak references to JPA callbacks on SessionFactory close

This commit is contained in:
Sanne Grinovero 2023-07-11 04:46:29 -04:00 committed by Sanne Grinovero
parent f3e11f1610
commit 724e376b7c
1 changed files with 4 additions and 1 deletions

View File

@ -166,7 +166,7 @@ public class SessionFactoryImpl extends QueryParameterBindingTypeResolverImpl im
private final transient Map<String,Object> settings;
private final transient SessionFactoryServiceRegistry serviceRegistry;
private final transient EventEngine eventEngine;
private final transient EventEngine eventEngine;//Needs to be closed!
private final transient JdbcServices jdbcServices;
private final transient SqlStringGenerationContext sqlStringGenerationContext;
@ -899,6 +899,9 @@ public class SessionFactoryImpl extends QueryParameterBindingTypeResolverImpl im
if ( queryEngine != null ) {
queryEngine.close();
}
if ( eventEngine != null ) {
eventEngine.stop();
}
}
finally {
status = Status.CLOSED;