Interface TransactionInfo
-
- All Known Implementing Classes:
Transaction
public interface TransactionInfoA view that provides information about a transaction- See Also:
Transaction
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description longgetDataVersion()Each transaction is allocated a serialization point by the transaction coordinator.ReadWritegetMode()What mode is this transaction? This may change fromREADtoWRITEin a transactions lifetime.TxnStategetState()The transaction lifecycle stateTxnIdgetTxnId()Get the transaction id for this transaction.TxnTypegetTxnType()What type is this transaction? This is the initial TxnType and does not change during a transaction's lifetime.booleanhasFinalised()Has the transaction gone through all lifecycle states?booleanhasFinished()Has the transaction finished (has commit/abort/end been called)?booleanhasStarted()Has the transaction started?default booleanisActiveTxn()Is this a view of a transaction that is active? Equivalent togetState() != INACTIVEdefault booleanisReadTxn()Is this currently a READ transaction? Promotion may change the mode.default booleanisWriteTxn()Is this a currently a WRITE transaction? Convenience operation equivalent to(getMode() == ReadWrite.WRITE)
-
-
-
Method Detail
-
getState
TxnState getState()
The transaction lifecycle state
-
getDataVersion
long getDataVersion()
Each transaction is allocated a serialization point by the transaction coordinator. Normally, this is related to this number and it increases over time as the data changes. Two readers can have the same serialization point - they are working with the same view of the data.
-
hasStarted
boolean hasStarted()
Has the transaction started?
-
hasFinished
boolean hasFinished()
Has the transaction finished (has commit/abort/end been called)?
-
hasFinalised
boolean hasFinalised()
Has the transaction gone through all lifecycle states?
-
getTxnId
TxnId getTxnId()
Get the transaction id for this transaction. Unique within this OS process (JVM) at least .
-
getTxnType
TxnType getTxnType()
What type is this transaction? This is the initial TxnType and does not change during a transaction's lifetime.
-
getMode
ReadWrite getMode()
What mode is this transaction? This may change fromREADtoWRITEin a transactions lifetime.
-
isReadTxn
default boolean isReadTxn()
Is this currently a READ transaction? Promotion may change the mode. Convenience operation equivalent to(getMode() == ReadWrite.READ)
-
isWriteTxn
default boolean isWriteTxn()
Is this a currently a WRITE transaction? Convenience operation equivalent to(getMode() == ReadWrite.WRITE)
-
isActiveTxn
default boolean isActiveTxn()
Is this a view of a transaction that is active? Equivalent togetState() != INACTIVE
-
-