Fix closing entity manager that uses a closed session factory, must throw IllegalStateException
This commit is contained in:
parent
c10c006b0d
commit
13ce7148ae
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue