Describe the bug
When working on #11230 and the associated PR #11328 I've discovered that Hibernate didn't remove orphan childs as expected in some cases.
This lead to Hibernate issue https://hibernate.atlassian.net/browse/HHH-15230 and a workaround of a modified Auto-Flush listener https://github.com/keycloak/keycloak/blob/main/model/map-jpa/src/main/java/org/keycloak/models/map/storage/jpa/hibernate/listeners/JpaAutoFlushListener.java#L82-L84
This issue tracks the upstream issue to remove the workaround once a fix is available.
Version
999-SNAPSHOT
Expected behavior
No custom auto-flush listener should be necessary.
Actual behavior
Custom auto-flush listener necessary as a workaround.
How to Reproduce?
See test case that triggered this was OIDCClientRegistrationTest.testClientWithScope as it was writing client properties multiple times in a session. This behavior might change in future setup; it is simpler to reproduce in the test case linked in the Hibernate issue.
Anything else?
No response
Describe the bug
When working on #11230 and the associated PR #11328 I've discovered that Hibernate didn't remove orphan childs as expected in some cases.
This lead to Hibernate issue https://hibernate.atlassian.net/browse/HHH-15230 and a workaround of a modified Auto-Flush listener https://github.com/keycloak/keycloak/blob/main/model/map-jpa/src/main/java/org/keycloak/models/map/storage/jpa/hibernate/listeners/JpaAutoFlushListener.java#L82-L84
This issue tracks the upstream issue to remove the workaround once a fix is available.
Version
999-SNAPSHOT
Expected behavior
No custom auto-flush listener should be necessary.
Actual behavior
Custom auto-flush listener necessary as a workaround.
How to Reproduce?
See test case that triggered this was OIDCClientRegistrationTest.testClientWithScope as it was writing client properties multiple times in a session. This behavior might change in future setup; it is simpler to reproduce in the test case linked in the Hibernate issue.
Anything else?
No response