Using spring with JPA + JTA and Hibernate 5.2.8.Final + Envers
The problem is that Springframework ORM (JPA subpackage) closes the entity manager During
When the Hibernate envers listeners are triggered (during
step), the entity manager is already closed.
In hibernate 4.x there's no problem because the EntityManager and hibernate Session are two different instances and closing the entity manager won't always close the hibernate session. In hibernate 5.2.x they are the same instance.
I created a small setup where I can reproduce the issue. Please find it attached.
This was originally reported in spring:
Additional information: I tested with Narayana 5.5.3.Final (instead of Atomikos) and I faced the same issue
The fix for this issue considered only one possible failure when executing Hibernate Envers Listeners
I'm getting other failures as you can see below:
Envers listeners try to initialize relationships as well, and the session is closed.
Should I report this in a separate issue?
yes please, can you open a separate issue with a test case?
The following issue: was created