Ensure that parent's version ID is incremented when an attribute changes#9894
Conversation
|
Testing this, I found that the optimistic locking failed when updating only some attributes: the version in the parent wasn't incremented as the the ManyToOne relation is owned by the child. I looked for a simple solution to change that ownership, but didn't succeed. I then added some hibernate listeners and iterfaces to trigger the essential The approach is inspired by https://vladmihalcea.com/jpa-entity-version-property-hibernate/ and https://vladmihalcea.com/hibernate-event-listeners/. I tested it manually by changing role attribute or changing a client's "Backchannel Logout Session Required" and running it with and without |
|
Will be reworked to supported multiple levels. Reverting to draft. |
…ges. This is necessary to allow the optimistic locking functionality to work as expected when changing only attributes on an entity. Closes keycloak#9874
14c455b to
b627e46
Compare
|
Has been reworked to supported multiple levels of parent-child-relationship. Ready for review. |
This is necessary to allow the optimistic locking functionality to work as expected when changing only attributes on an entity.
Closes #9874