Mike Becker (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6321cb8...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMjc0MWQ1MTk4...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15512?atlOrigin=eyJpIjoiMjc0MW...
) HHH-15512 (
https://hibernate.atlassian.net/browse/HHH-15512?atlOrigin=eyJpIjoiMjc0MW...
) Mysterious complain about orphan removel within a parameterized test case (
https://hibernate.atlassian.net/browse/HHH-15512?atlOrigin=eyJpIjoiMjc0MW...
)
Issue Type: Bug Affects Versions: 6.1.3 Assignee: Unassigned Components: hibernate-core
Created: 15/Sep/2022 01:55 AM Priority: Major Reporter: Mike Becker (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6321cb8...
)
I cannot even explain what is happening here, you have to see for yourself. But you need
JUnit 5 to run the test case below. The exception hibernate throws is the following:
A collection with cascade="all-delete-orphan" was no longer referenced by
the owning entity instance:
org.hibernate.bugs.TestHHH15511$EntityHHH15511.absolutelyIrrelevant
But absolutelyIrrelevant is indeed absolutely irrelevant. This collection is never touched
in the entire test case.
It looks like something bad is happening, when the persist() of the entities requires an
INSERT due to generation strategy IDENTITY. If I remove that, the bug does not occur. If I
keep the strategy IDENTITY and add a manual flush() after persist, the bug also does not
occur.
TODO: insert test case once the ticket number is generated.
(
https://hibernate.atlassian.net/browse/HHH-15512#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15512#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#100207- sha1:4ec4822 )