ConcurrentModificationException when adding a BeforeTransactionCompletionProcess from with a PostInsertEventListener for an @Audited entity

Description

Simple gradle project that demonstrates this issue

https://github.com/cameronbraid/hibernate-envers-cme

Clone it, run ./gradlew and see the exception

The issue arises with an @Audited entity when you add a BeforeTransactionCompletionProcess from within an PostInsertEventListener

main code is in https://github.com/cameronbraid/hibernate-envers-cme/blob/master/src/main/java/demo/Main.java

Environment

None

Status

Assignee

Lukasz Antoniak

Reporter

Cameron Braid

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure