Hi,
I am trying to use hibernate optimistic locking on one of my entities. I have a field with JPA annotations as such:
@Version
@Column (name = "version_number")
private Integer version;
I have wiped the database to start afresh but something odd happens. I have created 3 new entities. When I modify the first hibernate runs update statements against the first And the second entity, hence version numbers increase for both. I cannot think of any reason why hibernate should try and update the second entity.
When I modify the second created entity, it works fine and only the version number for this one is incremented.
Modifying the third entity runs updates (and increments versions) for inself and the second entity, which is also unexpected (and unwanted).
Would appreciate if anybody has experienced anything similar and can offer any exoplantion.
(I am using JPA with hibernate underneath)
|