As I understand, JPA 1.0 LockModeType.write
works with field annotated @Version
.
This field is incremented each time, when entity is read or written. But how JPA works when this field is absent?
As I understand, JPA 1.0 LockModeType.write
works with field annotated @Version
.
This field is incremented each time, when entity is read or written. But how JPA works when this field is absent?
Take a look at Field Locking
. When using field locking fields are compared when updating.
Take a look at here.
Lock mode only applies to entities configured with an @Version. It will either throw an error, or have no affect without a version.
JPA 2 also defines pessimistic locking, and some JPA providers provide other forms of locking.