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-element-collection-after-skipped-autoflush|https://github.com/ahus1/hibernate-test-case-templates/tree/is-HHH-xxxx-element-collection-after-skipped-autoflush|smart-link]
Keycloak issue: [https://github.com/keycloak/keycloak/issues/19162|https://github.com/keycloak/keycloak/issues/19162|smart-link] |
|