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: