| java.lang.Object org.hibernate.LockMode
LockMode | final public class LockMode implements Serializable(Code) | | Instances represent a lock mode for a row of a relational
database table. It is not intended that users spend much
time worrying about locking since Hibernate usually
obtains exactly the right lock level automatically.
Some "advanced" users may wish to explicitly specify lock
levels.
See Also: Session.lock(ObjectLockMode) author: Gavin King |
Field Summary | |
final public static LockMode | FORCE Similiar to
LockMode.UPGRADE except that, for versioned entities,
it results in a forced version increment. | final public static LockMode | NONE No lock required. | final public static LockMode | READ A shared lock. | final public static LockMode | UPGRADE An upgrade lock. | final public static LockMode | UPGRADE_NOWAIT Attempt to obtain an upgrade lock, using an Oracle-style
select for update nowait. | final public static LockMode | WRITE A WRITE lock is obtained when an object is updated
or inserted. |
FORCE | final public static LockMode FORCE(Code) | | Similiar to
LockMode.UPGRADE except that, for versioned entities,
it results in a forced version increment.
|
NONE | final public static LockMode NONE(Code) | | No lock required. If an object is requested with this lock
mode, a READ lock will be obtained if it is
necessary to actually read the state from the database,
rather than pull it from a cache.
This is the "default" lock mode.
|
READ | final public static LockMode READ(Code) | | A shared lock. Objects in this lock mode were read from
the database in the current transaction, rather than being
pulled from a cache.
|
UPGRADE | final public static LockMode UPGRADE(Code) | | An upgrade lock. Objects loaded in this lock mode are
materialized using an SQL select ... for update.
|
UPGRADE_NOWAIT | final public static LockMode UPGRADE_NOWAIT(Code) | | Attempt to obtain an upgrade lock, using an Oracle-style
select for update nowait. The semantics of
this lock mode, once obtained, are the same as
UPGRADE.
|
WRITE | final public static LockMode WRITE(Code) | | A WRITE lock is obtained when an object is updated
or inserted. This lock mode is for internal use only and is
not a valid mode for load() or lock() (both
of which throw exceptions if WRITE is specified).
|
greaterThan | public boolean greaterThan(LockMode mode)(Code) | | Check if this lock mode is more restrictive than the given lock mode.
Parameters: mode - LockMode to check true if this lock mode is more restrictive than given lock mode |
lessThan | public boolean lessThan(LockMode mode)(Code) | | Check if this lock mode is less restrictive than the given lock mode.
Parameters: mode - LockMode to check true if this lock mode is less restrictive than given lock mode |
|
|