mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 00:24:57 +00:00
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 @@ 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();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user