public enum CdbLockType extends Enum<CdbLockType>
DB lock type flag for Cdb Sessions which controls locking of sessions.
LOCK_SESSION
or LOCK REQUESTS
are mutually exclusive and controls if the lock should be held for the
complete session or for each request respectively.
LOCK_WAIT
can be combined with either
LOCK_SESSION
or LOCK_REQUEST
to control if lock requests should block and wait for lock. Default
behavior is to fail if lock cannot be obtained.
LOCK_PARTIAL
can be combined
with LOCK_REQUEST
to control the lock to hold only for
the subtree from the point of access for the request.
Default behavior is that the complete CDB database is locked.
Locks are combined using EnumSet for example as
EnumSeteSet = EnumSet.of(CdbLockType.LOCK_REQUEST, CdbLockType.LOCK_PARTIAL, CdbLockType.LOCK_WAIT);
Enum Constant and Description |
---|
LOCK_PARTIAL
Controls if locks of type LOCK_REQUEST should be partial
i.e.
|
LOCK_REQUEST
Obtain read lock for each read request
|
LOCK_SESSION
Obtain read lock for the complete session
|
LOCK_WAIT
Controls in combination with one of LOCK_SESSION or LOCK_REQUEST if the
call should wait instead of fail if lock is not obtained.
|
Modifier and Type | Method and Description |
---|---|
int |
getValue() |
static CdbLockType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CdbLockType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CdbLockType LOCK_PARTIAL
public static final CdbLockType LOCK_REQUEST
public static final CdbLockType LOCK_SESSION
public static final CdbLockType LOCK_WAIT
public int getValue()
public static CdbLockType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic static CdbLockType[] values()
for (CdbLockType c : CdbLockType.values()) System.out.println(c);