Kurt Gollhardt (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYzIxYjFhYzNk...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16010?atlOrigin=eyJpIjoiYzIxYj...
) HHH-16010 (
https://hibernate.atlassian.net/browse/HHH-16010?atlOrigin=eyJpIjoiYzIxYj...
) DefaultEvictEventListener calls handleEviction with swapped parameters (
https://hibernate.atlassian.net/browse/HHH-16010?atlOrigin=eyJpIjoiYzIxYj...
)
Issue Type: Bug Affects Versions: 6.1.6 Assignee: Unassigned Components: hibernate-core
Created: 10/Jan/2023 02:09 AM Priority: Major Reporter: Kurt Gollhardt (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Original estimate: 0.5h Remaining Estimate: 0.5h
Looks like this was broken by the change of IDs from Serializable to Object. The order of
parameters to NaturalIdResolutions::handleEviction was changed. The call from
DefaultEvictEventListener was also changed, but incorrectly. The first two parameters
(should be id, object) are swapped (object, id). The compiler doesn’t catch this because
they’re now both of type Object.
This eventually results in the equals() method of any object already in the cache to be
called with the ID of the object being evicted, rather than the object itself, and so
findCachedNaturalIdById never finds anything, and removeResolution doesn’t remove the
naturalId from the cache. I don’t know what the implications are of leaving a “dangling
reference” like this in the cache (presumably discarded once the session is closed).
(
https://hibernate.atlassian.net/browse/HHH-16010#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16010#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#100213- sha1:cca7326 )