[hibernate-issues] [JIRA] (HHH-14008) "Shared reference" exception thrown due to issue with batch fetching detaching locked entities in batch fetch

Caspian Borison (JIRA) jira at hibernate.atlassian.net
Sat May 9 01:35:28 EDT 2020


Caspian Borison ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Abead8085-c796-4d7d-9fa0-0ec2008c7f92 ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZDMzZDM0YTUyNTczNDBmMmJhNjcxZjM2MzlmNWVkNjMiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14008?atlOrigin=eyJpIjoiZDMzZDM0YTUyNTczNDBmMmJhNjcxZjM2MzlmNWVkNjMiLCJwIjoiaiJ9 ) HHH-14008 ( https://hibernate.atlassian.net/browse/HHH-14008?atlOrigin=eyJpIjoiZDMzZDM0YTUyNTczNDBmMmJhNjcxZjM2MzlmNWVkNjMiLCJwIjoiaiJ9 ) "Shared reference" exception thrown due to issue with batch fetching detaching locked entities in batch fetch ( https://hibernate.atlassian.net/browse/HHH-14008?atlOrigin=eyJpIjoiZDMzZDM0YTUyNTczNDBmMmJhNjcxZjM2MzlmNWVkNjMiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 5.3.17, 5.4.15 Assignee: Unassigned Components: hibernate-core Created: 08/May/2020 22:35 PM Priority: Major Reporter: Caspian Borison ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Abead8085-c796-4d7d-9fa0-0ec2008c7f92 )

Hibernate seems to have an issue under the following scenario with the following simple mappings (all lazy)

* * Parent -> OneToMany -> Child
* Child -> ManyToOne -> Parent

* Enable batch fetching
* Read in Parent1 and a (non-related) Child
* Lock and refresh the original Parent1 / 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

Note I believe this issue is also related to HHH-12268 ( https://hibernate.atlassian.net/browse/HHH-12268 ) Open which still also exists in the latest 5.x versions.

( https://hibernate.atlassian.net/browse/HHH-14008#add-comment?atlOrigin=eyJpIjoiZDMzZDM0YTUyNTczNDBmMmJhNjcxZjM2MzlmNWVkNjMiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14008#add-comment?atlOrigin=eyJpIjoiZDMzZDM0YTUyNTczNDBmMmJhNjcxZjM2MzlmNWVkNjMiLCJwIjoiaiJ9 )

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.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100126- sha1:9bc00fe )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200509/d430fad3/attachment.html 


More information about the hibernate-issues mailing list