Alexander Schwartz (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6267ec4...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiOWQ0M2MyZmRk...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16337?atlOrigin=eyJpIjoiOWQ0M2...
) HHH-16337 (
https://hibernate.atlassian.net/browse/HHH-16337?atlOrigin=eyJpIjoiOWQ0M2...
) EntityCollection is not deleted when replaced (
https://hibernate.atlassian.net/browse/HHH-16337?atlOrigin=eyJpIjoiOWQ0M2...
)
Issue Type: Bug Affects Versions: 6.2.0.CR3 Assignee: Unassigned Components:
hibernate-core Created: 20/Mar/2023 05:04 AM Environment: JDK11, Linux Priority: Major
Reporter: Alexander Schwartz (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6267ec4...
)
For the Keycloak project, I was able to reproduce the following:
* Run Hibernate 6.2.0.CR3 on Quarkus aka Bytecode enhanced
* Load an entry with a collection (ElementCollection in our case)
* Replace the collection with a new collection
* Run an unrelated query to trigger an autoflush test -> this will initialize a
CollectionEntry with ignore=true, so it will be ignored throughout this session
* commit
Expected result: Only new entries are in the database
Actual Result: Old and new entries are now in the database, als the old entries
haven't been deleted.
This problem doesn’t occur when bytecode enhancement is not used.
Reproducer test case:
https://github.com/ahus1/hibernate-test-case-templates/tree/is-HHH-xxxx-e...
(
https://github.com/ahus1/hibernate-test-case-templates/tree/is-HHH-xxxx-e...
)
(
https://hibernate.atlassian.net/browse/HHH-16337#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16337#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#100218- sha1:fe49d35 )