I would like to know precisely when the field annotated with @Version
is effectively incremented (and accessible with its incremented value) on the entity among the following processings :
entitymanager.flush()
(triggered or not by commit)@PreUpdate
annotated callback method@PostUpdate
annotated callback methodThank you
You can find the code that is executed during update in org.hibernate.action.internal.EntityUpdateAction#execute
. The version in the object is updated after @PreUpdate
and before @PostUpdate
are called.