Multiple revisions are created during a single transaction with FlushMode COMMIT

Description

When the FlushMode is set to commit, a manual flush during a transaction leads to multiple audit revision to be created.

Consider the following example:

In the example the persisted entity should have the same revision number ass the revision number obtained before the flush. However, the entity will be assigned to a new revision number.

It seems that the AuditProcess does check for FlushMode COMMIT instead of FlushMode MANUAL. This has been introduced with 5.2.

Environment

None

Activity

Show:
Felix Feisst
March 16, 2017, 8:51 PM

I have added a PR with a unit test and a fix: https://github.com/hibernate/hibernate-orm/pull/1851

Chris Cranford
March 21, 2017, 1:10 PM

Thanks for the PR, , I'll have a look.

Gail Badner
April 4, 2017, 5:58 AM

, I tried the test case using 5.1, but there was no test failure. Does this bug really affect 5.1?

Felix Feisst
April 4, 2017, 6:23 AM

@Gail Badner, I think the bug has been introduced with 5.2. Therefore I set "worked in" version to 5.1.5 when I created this issue.

Assignee

Chris Cranford

Reporter

Felix Feisst

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.1.5

Components

Affects versions

Priority

Major
Configure