Fabian Köntopp (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6278292...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYzFhY2FjYTY2...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15459?atlOrigin=eyJpIjoiYzFhY2...
) HHH-15459 (
https://hibernate.atlassian.net/browse/HHH-15459?atlOrigin=eyJpIjoiYzFhY2...
) OPTIMISTIC_FORCE_INCREMENT and PESSIMISTIC_FORCE_INCREMENT update version more then once
(
https://hibernate.atlassian.net/browse/HHH-15459?atlOrigin=eyJpIjoiYzFhY2...
)
Issue Type: Bug Affects Versions: 5.6.10 Assignee: Unassigned Components: hibernate-core
Created: 22/Aug/2022 05:05 AM Priority: Major Reporter: Fabian Köntopp (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=6278292...
)
When using this (
https://vladmihalcea.com/how-to-increment-the-parent-entity-version-whene...
) proposal from @Vlad Mihalcea, updating multiple fields from multiple childs in one
transaction increases the version number not by one but by the number of changed child
entities.
My understanding is, that the version number should be updated only once for one
transaction even if the OPTIMISTIC_FORCE_INCREMENT or PESSIMISTIC_FORCE_INCREMENT lock
modes are used multiple times in it.
(
https://hibernate.atlassian.net/browse/HHH-15459#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15459#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#100205- sha1:59a7aeb )