Simon Seyock (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=62f3875...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZmY2MmIyNDU4...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15445?atlOrigin=eyJpIjoiZmY2Mm...
) HHH-15445 (
https://hibernate.atlassian.net/browse/HHH-15445?atlOrigin=eyJpIjoiZmY2Mm...
) Envers inserts erronous revision entries for many-to-many relation if using
`global_with_modified_flag` (
https://hibernate.atlassian.net/browse/HHH-15445?atlOrigin=eyJpIjoiZmY2Mm...
)
Issue Type: Bug Affects Versions: 5.6.9 Assignee: Chris Cranford (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Components: hibernate-envers Created: 10/Aug/2022 03:45 AM Priority: Major Reporter:
Simon Seyock (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=62f3875...
)
If using the config option global_with_modified_flag , envers creates erronous audit
entries for ManyToMany relations in certain cases.
Suppose EntityA and EntityB are related via a ManyToMany relation and EntityA is the
owning side of the relation. In this case I can remove an EntityB from the relation,
persist the EntityA and the relation is updated correctly. If envers is configured with `
global_with_modified_flag , it creates 3 audit entries, one for the relation, one for the
owning and one for the owned side. The audit entry for the owned side does not contain any
data except for id , rev , revtype and the *_mod fields. The _mod field that corresponds
to the relation is set to true like it is expected. All other fields are null.
I would expect that all other fields are filled with the current values.
I wrote a reproducer for this problem, the last assert fails:
https://github.com/simonseyock/hibernate-test-case-templates/blob/many-to...
(
https://github.com/simonseyock/hibernate-test-case-templates/blob/many-to...
)
If anyone can help me with a workaround for this, I would be very thankful.
(
https://hibernate.atlassian.net/browse/HHH-15445#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15445#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100204- sha1:2e7ea99 )