Fix closing entity manager that uses a closed session factory, must throw IllegalStateException

This commit is contained in:
Andrea Boriero 2016-04-28 10:30:20 +01:00 committed by Steve Ebersole
parent c10c006b0d
commit 13ce7148ae

View File

@ -400,8 +400,10 @@ private void internalClear() {
public void close() throws HibernateException { public void close() throws HibernateException {
log.tracef( "Closing session [%s]", getSessionIdentifier() ); log.tracef( "Closing session [%s]", getSessionIdentifier() );
// todo : we want this check if usage is JPA, but not native Hibernate usage // todo : we want this check if usage is JPA, but not native Hibernate usage
// checkOpen(); if ( getSessionFactory().getSessionFactoryOptions().isJpaBootstrap() ) {
checkOpen();
}
super.close(); super.close();