public enum TxnType extends Enum<TxnType>
| Enum Constant and Description |
|---|
READ
Transaction mode:
WRITE: this guarantees a WRITE will complete if commit() is
called. |
READ_COMMITTED_PROMOTE |
READ_PROMOTE |
WRITE |
| Modifier and Type | Method and Description |
|---|---|
static TxnType |
convert(ReadWrite rw)
Convert a
ReadWrite mode to TxnType |
static ReadWrite |
convert(TxnType txnType)
Convert a
TxnType mode to ReadWrite : "promote" not supported. |
static ReadWrite |
initial(TxnType txnType)
Translate a
TxnType to it's initial ReadWrite mode. |
static TxnType |
promote(Transactional.Promote promoteMode)
Convert a
TxnType mode to ReadWrite : "promote" not supported. |
static TxnType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TxnType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TxnType READ
WRITE: this guarantees a WRITE will complete if commit() is
called. The same as begin(ReadWrite.WRITE).
READ: the transaction can not promote to WRITE,ensuring read-only
access to the data. The same as begin(ReadWrite.READ).
READ_PROMOTE: the transaction will go from "read" to "write" if the
dataset has not been modified but if it has, the promotion fails with
exception.
READ_COMMITTED_PROMOTE: Use this with care. The promotion will succeed but
changes from other transactions become visible.
begin). If READ_PROMOTE, the dataset must not have
changed; if READ_COMMITTED_PROMOTE any intermediate changes are
visible but the application can not assume any data it has read in the
transaction is the same as it was at the point the transaction started.public static final TxnType WRITE
public static final TxnType READ_PROMOTE
public static final TxnType READ_COMMITTED_PROMOTE
public static TxnType[] values()
for (TxnType c : TxnType.values()) System.out.println(c);
public static TxnType 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 ReadWrite convert(TxnType txnType)
TxnType mode to ReadWrite : "promote" not supported.public static ReadWrite initial(TxnType txnType)
TxnType to it's initial ReadWrite mode.
WRITE -> WRITE, READ* -> READ regardless of promotion setting.public static TxnType promote(Transactional.Promote promoteMode)
TxnType mode to ReadWrite : "promote" not supported.Licenced under the Apache License, Version 2.0