Caspian Borison (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiOWYzNjY3NjE4...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-14008?atlOrigin=eyJpIjoiOWYzNj...
) HHH-14008 (
https://hibernate.atlassian.net/browse/HHH-14008?atlOrigin=eyJpIjoiOWYzNj...
) "Found shared references to collection" exception thrown due to issue with
batch fetching duplicating locked entities on refresh (
https://hibernate.atlassian.net/browse/HHH-14008?atlOrigin=eyJpIjoiOWYzNj...
)
Change By: Caspian Borison (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Hibernate seems to have an issue under the following scenario (assuming these mappings):
* Parent -> OneToMany -> Child
* Child -> ManyToOne -> Parent
# Enable batch fetching
# Read in Parent1 and a (non-related) Child
# Lock and refresh the original Parent1 then refresh it / this will prompt a batch fetch
of the other child's ParentX
## At this time, it appears the original Parent1 is "duplicated" in the session
cache
# Directly read in a Child associated with Parent1
# Refresh the original reference to Parent1 causing Hibernate to now directly see two
Parent1s in the cache
# Flush the session
Test cases have been attached and can also be retrieved from
GitHub: [https://github.com/caspianb/HibernateRefreshTest/tree/HHH-14008...
Note, this seems seems somewhat related to:
[HHH-12268] (which still exists in the latest 5.x versions).
However, this issue does not seem to occur in 5.4.15 (only in 5.3.17) while the above
issue does occur in both.
(
https://hibernate.atlassian.net/browse/HHH-14008#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-14008#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#100126- sha1:9bc00fe )