public final class LockMode extends Object implements Serializable
Session.lock(Object,LockMode)
,
Serialized FormModifier and Type | Field and Description |
---|---|
static LockMode |
FORCE
Deprecated.
instead use PESSIMISTIC_FORCE_INCREMENT
|
static LockMode |
NONE
No lock required.
|
static LockMode |
OPTIMISTIC
Optimisticly assume that transaction will not experience contention for
entities.
|
static LockMode |
OPTIMISTIC_FORCE_INCREMENT
Optimisticly assume that transaction will not experience contention for entities.
|
static LockMode |
PESSIMISTIC_FORCE_INCREMENT
Transaction will immediately increment the entity version.
|
static LockMode |
PESSIMISTIC_READ
Implemented as PESSIMISTIC_WRITE.
|
static LockMode |
PESSIMISTIC_WRITE
Transaction will obtain a database lock immediately.
|
static LockMode |
READ
A shared lock.
|
static LockMode |
UPGRADE
Deprecated.
instead use PESSIMISTIC_WRITE
|
static LockMode |
UPGRADE_NOWAIT
Attempt to obtain an upgrade lock, using an Oracle-style
select for update nowait.
|
static LockMode |
WRITE
A WRITE lock is obtained when an object is updated
or inserted.
|
Modifier and Type | Method and Description |
---|---|
boolean |
greaterThan(LockMode mode)
Check if this lock mode is more restrictive than the given lock mode.
|
boolean |
lessThan(LockMode mode)
Check if this lock mode is less restrictive than the given lock mode.
|
static LockMode |
parse(String name) |
String |
toString() |
public static final LockMode NONE
public static final LockMode READ
public static final LockMode UPGRADE
public static final LockMode UPGRADE_NOWAIT
public static final LockMode WRITE
public static final LockMode FORCE
UPGRADE
except that, for versioned entities,
it results in a forced version increment.public static final LockMode OPTIMISTIC
public static final LockMode OPTIMISTIC_FORCE_INCREMENT
public static final LockMode PESSIMISTIC_READ
public static final LockMode PESSIMISTIC_WRITE
public static final LockMode PESSIMISTIC_FORCE_INCREMENT
public boolean greaterThan(LockMode mode)
mode
- LockMode to checkpublic boolean lessThan(LockMode mode)
mode
- LockMode to checkCopyright © 2002-2015 Red Hat Middleware, LLC. All Rights Reserved