You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whereas EntityManagerFactoryUtils.closeEntityManager() will check if EntityManager is open before trying to close it, SessionFactoryUtils.closeSession() doesn't check if session is open.
As a consequence, if EntityManager is closed when entering closeEntityManager(), nothing will happen,
whereas if Session is closed when entering closeSession(), a log ERROR will be generated (because of "org.hibernate.SessionException: Session was already closed") (tested with Spring 5.2 + Hibernate 5.1).
Maybe we could have a common behaviour between both classes ?
See related commit for EntityManagerFactoryUtils : 928f542
Context :
module spring-orm
class org.springframework.orm.jpa.EntityManagerFactoryUtils
class org.springframework.orm.hibernate5.SessionFactoryUtils
The text was updated successfully, but these errors were encountered:
Whereas
EntityManagerFactoryUtils.closeEntityManager()
will check if EntityManager is open before trying to close it,SessionFactoryUtils.closeSession()
doesn't check if session is open.As a consequence, if EntityManager is closed when entering
closeEntityManager()
, nothing will happen,whereas if Session is closed when entering
closeSession()
, a log ERROR will be generated (because of "org.hibernate.SessionException: Session was already closed") (tested with Spring 5.2 + Hibernate 5.1).Maybe we could have a common behaviour between both classes ?
See related commit for EntityManagerFactoryUtils : 928f542
Context :
org.springframework.orm.jpa.EntityManagerFactoryUtils
org.springframework.orm.hibernate5.SessionFactoryUtils
The text was updated successfully, but these errors were encountered: