EnversPreCollectionRemoveEventListener fails because EntityManager is closed when using JPA + JTA + Envers

Description

My environment:
Using spring with JPA + JTA and Hibernate 5.2.9.Final + Envers

This issue is related to

When deleting an entity that has a one-to-many relationship to another one (without cascade delete), EnversPreCollectionRemoveEventListener might fail since entity manager is already closed.

Test case is attached: MyApp.zip
Main class: com.myapp.App

Environment

None

Status

Assignee

Andrea Boriero

Reporter

Jones

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure