Envers - modified flag column value set to null from 5.4.7 onwards

Description

Release 5.4.7 and beyond has introduced an issue in Envers (for me, at least) whereby some modified flag column values are always null which causes data constraint violations and an inability to persist entities and auditing info.

This may be related to this issue: HHH-10398

I have a class with a number of @Audited annotations. The simple string value fields (name, description etc) work as expected and I can see in the logs that hibernate is persisting the modified flag column value correctly - true on create and false/true on update thereafter. The @Enumerated and @ManyToOne mappings modified column values are always null. I went back to release version 5.3.14.Final which works for me and every release up to and including 5.4.6 works.

Below is an abbreviated class with the relevant annotations. There are other mappings that I have omitted for brevity - some audited OneToOne and OneToMany that work as expected.

Relevant configuration entries:

Thanks,
Craig

Environment

Hibernate 5.4.9.Final
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)
mysql Ver 14.14 Distrib 5.7.27, for macos10.14 (x86_64) using EditLine wrapper
Spring boot 2.2.2-Release

Activity

Show:
Chris Cranford
January 14, 2020, 12:11 AM

Hi , thanks for the report. I've identified the issue and I'll work on trying to get a fix for it this week.

Chris Cranford
January 14, 2020, 12:56 AM

Hi , I've added PR https://github.com/hibernate/hibernate-orm/pull/3171. If time permits and you can; would you be able to build that into master and let me know if that fixes your issue as I couldn't see any side effects once I made this fix.

Craig Chapman
January 15, 2020, 1:35 AM

Thanks Chris. I probably won’t be able to get to it this week but I’ll do my best to take a look next week when I have a bit of spare time.

Thanks again,

Craig

Assignee

Chris Cranford

Reporter

Craig Chapman

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.4.1
5.4.2
5.4.3
5.4.4
5.4.5
5.4.6
5.3.14

Components

Affects versions

Priority

Blocker
Configure