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:
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
Hi , thanks for the report. I've identified the issue and I'll work on trying to get a fix for it this week.
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.
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.