Java Reference
In-Depth Information
@Version
protected Short getVersion() { ... }
Lock Modes
The application may increase the level of locking for an entity by specifying the use of
lock modes. Lock modes may be specified to increase the level of optimistic locking or to
request the use of pessimistic locks.
The use of optimistic lock modes causes the persistence provider to check the version at-
tributes for entities that were read (but not modified) during a transaction as well as for
entities that were updated.
The use of pessimistic lock modes specifies that the persistence provider is to immediately
acquire long-term read or write locks for the database data corresponding to entity state.
The lock mode for an entity operation may be set by specifying one of the lock modes
defined in the javax.persistence.LockModeType enumerated type, listed in
Table 17-1 .
Search WWH ::




Custom Search