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
1 changed files with 4 additions and 2 deletions

View File

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