AuditJoinTable rows are no longer flushed to the database

Description

In Hibernate core 3.5.1 issue was fixed by using BeforeTransactionCompletionProcess instead of a transaction synchronization. I have found that since this change, rows in AuditJoinTables are no longer flushed to the database. (Envers 3.5.0 final works fine).

I can work around the issue by adding a manual entityManager.flush() or by setting the flushmode to manual.

I have noticed that AuditProcess.java already executes a flush() statement, but this does not seem to suffice. I believe this is caused by the fact that during the doBeforeTransactionCompletion() extra WorkUnits are added to the hibernate ActionQueue (PersistentCollectionChangeWorkUnit) which process the AuditJoinTables.

Environment

JPA with extended persistence context

Status

Assignee

AdamA

Reporter

Erik-Berndt Scheper

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

3.5.2
3.5.1

Priority

Minor
Configure