public enum LockMode extends Enum<LockMode> implements MultiverseConstants
Txn.
Normally transactions are very optimistic (e.g. fail during execution or at the end because some read or
write conflict was detected), but in some cases a more pessimistic approach is better. For more information
see Lock.
TxnFactoryBuilder.setReadLockMode(LockMode),
TxnFactoryBuilder.setWriteLockMode(LockMode),
TxnConfig.getReadLockMode(),
TxnConfig.getWriteLockMode(),
TxnObject.getLock(),
Lock| Enum Constant and Description |
|---|
Exclusive
The ExclusiveLock can be compared with the writelock of a traditional read/write lock.
|
None
No locking is done.
|
Read
The LockMode.Read prevents others to acquire the Write/Exclusive-lock, but it allows others to acquire the
Read lock.
|
Write
The LockMode.Write prevents others to acquire the Read/Write/Exclusive-lock.
|
LOCKMODE_EXCLUSIVE, LOCKMODE_NONE, LOCKMODE_READ, LOCKMODE_WRITE, SHAKE_BUGS, SPIN_YIELD, TRACING_ENABLED| Modifier and Type | Method and Description |
|---|---|
int |
asInt() |
static LockMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LockMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LockMode None
public static final LockMode Read
public static final LockMode Write
public static final LockMode Exclusive
The ExclusiveLock is the Lock acquired by the STM once a Txn is prepared for writing changes to a TxnObject.
public static LockMode[] values()
for (LockMode c : LockMode.values()) System.out.println(c);
public static LockMode 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 int asInt()
Copyright © 2025. All rights reserved.