I am working through upgrading a large repo from Hibernate 5.4 to Hibernate 6.0, and I am running into the following issue.
During an auto flush, one of my entities is passing through what looks like a new class introduced in Hibernate 6 called
DirtyHelper. In a method called
isModified(), there is a comparison between the “previous state” and the “current state” of the object, each of which is just an array of property values.
However, the number of array entries in each array doesn’t match. In this specific case, my previous state contains 28 entries and my current state contains 32 entries. This leads to an
ArrayIndexOutOfBoundsException as it loops through the current state, and eventually runs out of entries to compare in the previous state.
What I’ve managed to determine is that the “previous state” is missing entries for columns that have been marked with the annotation
@OneToOne(mappedBy = "myDomainObject"). When debugging internally, this appears to be deliberate.
Does anybody have any clues as to how I might have triggered this issue?