Oleksii Miroshnyk (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a157d9...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZjkyYWEyOTA0...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16665?atlOrigin=eyJpIjoiZjkyYW...
) HHH-16665 (
https://hibernate.atlassian.net/browse/HHH-16665?atlOrigin=eyJpIjoiZjkyYW...
) False positive HibernateException: Found shared references to a collection with 6.2.2 (
https://hibernate.atlassian.net/browse/HHH-16665?atlOrigin=eyJpIjoiZjkyYW...
)
Issue Type: Bug Affects Versions: 6.2.2 Assignee: Unassigned Components:
hibernate-orm-modules Created: 22/May/2023 05:55 AM Environment: hibernate 6.2.2 Priority:
Major Reporter: Oleksii Miroshnyk (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a157d9...
)
So I have the following setup:
Product → one-to-one->Sku-(embeds) PriceListSkuImpl >one-to-many->SkuPriceData
one-to-many
CategoryProductXref->many-to-one->Category
At some point I’m “cloning” a product(given the error I checked a number of times that I
don’t re-assign or “clone” any collection) which in test-case I mimic by creating a new
product. Then do refresh to both original and clone and that’s it.
In test I also read category, and some other product, and initialize collections by
accessing them, which seems is required to reproduce the issue.
So once the final flush is happening I’m getting the Found shared references error for
SkuImpl.priceListSku.priceDataList
And the interesting thing that error(if you do debug) will be related to some other
product/sku that didn’t participate in the cloning process, but just belong to the same
category that original product does.
While debigging I think there is some issue with handling cycles in the entity graph, so
seems it does:
Product->sku->priceDataList
then it does
Product->category_xref->category->all-product-in-category->category_xref->product->sku->priceDatalist
and fails…
(
https://hibernate.atlassian.net/browse/HHH-16665#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16665#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#100225- sha1:bbd69a1 )