public final class Transaction extends Object implements TransactionInfo
TransactionCoordinator,
TransactionalComponent| Constructor and Description |
|---|
Transaction(TransactionCoordinator txnMgr,
TxnType txnType,
ReadWrite readWrite,
TxnId txnId,
long dataVersion,
List<org.apache.jena.dboe.transaction.txn.SysTrans> components) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort() |
void |
begin() |
void |
commit() |
void |
end() |
void |
ensureWriteTxn()
Require a WRITE transaction - includes trying to promote.
|
long |
getDataVersion()
Each transaction is allocated a serialization point by the transaction
coordinator.
|
ReadWrite |
getMode()
What mode is this transaction?
This may change from
READ to WRITE in a transactions lifetime. |
TxnState |
getState()
The transaction lifecycle state
|
TxnId |
getTxnId()
Get the transaction id for this transaction.
|
TxnType |
getTxnType()
What type is this transaction? This is the initial TxnType
and does not change during a transaction's lifetime.
|
boolean |
hasFinalised()
Has the transaction gone through all lifecycle states?
|
boolean |
hasFinished()
Has the transaction finished (has commit/abort/end been called)?
|
boolean |
hasStarted()
Has the transaction started?
|
boolean |
isActiveTxn()
Is this a view of a transaction that is active?
Equivalent to
getState() != INACTIVE |
boolean |
isReadTxn()
Is this a READ transaction?
Convenience operation equivalent to
(getMode() == READ) |
boolean |
isWriteTxn()
Is this a WRITE transaction?
Convenience operation equivalent to
(getMode() == WRITE) |
void |
notifyUpdate() |
void |
prepare() |
boolean |
promote() |
boolean |
promote(boolean readCommitted) |
void |
requireWriteTxn()
Require a WRITE transaction - do not try to promote.
|
public Transaction(TransactionCoordinator txnMgr, TxnType txnType, ReadWrite readWrite, TxnId txnId, long dataVersion, List<org.apache.jena.dboe.transaction.txn.SysTrans> components)
public TxnState getState()
TransactionInfogetState in interface TransactionInfopublic long getDataVersion()
getDataVersion in interface TransactionInfopublic void begin()
public boolean promote()
public boolean promote(boolean readCommitted)
public void notifyUpdate()
public void prepare()
public void commit()
public void abort()
public void end()
public void requireWriteTxn()
public void ensureWriteTxn()
public boolean hasStarted()
TransactionInfohasStarted in interface TransactionInfopublic boolean hasFinished()
TransactionInfohasFinished in interface TransactionInfopublic boolean hasFinalised()
TransactionInfohasFinalised in interface TransactionInfopublic TxnId getTxnId()
TransactionInfogetTxnId in interface TransactionInfopublic TxnType getTxnType()
TransactionInfogetTxnType in interface TransactionInfopublic ReadWrite getMode()
TransactionInfoREAD to WRITE in a transactions lifetime.getMode in interface TransactionInfopublic boolean isReadTxn()
(getMode() == READ)isReadTxn in interface TransactionInfopublic boolean isWriteTxn()
(getMode() == WRITE)isWriteTxn in interface TransactionInfopublic boolean isActiveTxn()
TransactionInfogetState() != INACTIVEisActiveTxn in interface TransactionInfoLicensed under the Apache License, Version 2.0