Interface Transaction
- All Known Implementing Classes:
BindingsTransactionImpl,TransactionImpl
public interface Transaction
An ActiveMQ Artemis internal transaction
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidThis is an operation that will be called right after the storage is completed. addOperation could only happen after paging and replication, while these operations will just be about the storagevoidafterWired(Runnable runnable) voidcommit()voidcommit(boolean onePhase) createRefsOperation(Queue queue, AckReason reason) voiddelay()Calling this will defer the storage of the commit or prepare until delayDone is called.voidThis is to be called when the delay portion is done.longlonggetID()getProperty(int index) getState()getXid()booleanTo validate if the Transaction had previously timed out.booleanhasTimedOut(long currentTime, int defaultTimeout) default booleanbooleanisAsync()booleanbooleanvoidmarkAsRollbackOnly(ActiveMQException exception) voidprepare()voidputProperty(int index, Object property) voidresume()voidrollback()setAsync(boolean async) To be used on control transactions that are meant as internal and don't really require a hard sync.voidvoidsetProtocolData(Object data) Protocol managers can use this field to store any object needed.voidsetState(Transaction.State state) voidsetTimeout(int timeout) voidsuspend()booleanIn a ServerSession failure scenario,\ we may try to rollback, however only if it's not prepared.
-
Method Details
-
getProtocolData
Object getProtocolData() -
setProtocolData
Protocol managers can use this field to store any object needed. An example would be the Session used by the transaction on openwire -
isEffective
boolean isEffective() -
prepare
- Throws:
Exception
-
commit
- Throws:
Exception
-
commit
- Throws:
Exception
-
rollback
- Throws:
Exception
-
tryRollback
boolean tryRollback()In a ServerSession failure scenario,\ we may try to rollback, however only if it's not prepared. In case it's prepared, we will just let it be and let the transaction manager to deal with it -
getID
long getID() -
getXid
Xid getXid() -
suspend
void suspend() -
resume
void resume() -
getState
Transaction.State getState() -
setState
-
markAsRollbackOnly
-
getCreateTime
long getCreateTime() -
addOperation
-
afterWired
-
afterStore
This is an operation that will be called right after the storage is completed. addOperation could only happen after paging and replication, while these operations will just be about the storage -
getAllOperations
List<TransactionOperation> getAllOperations() -
hasTimedOut
boolean hasTimedOut(long currentTime, int defaultTimeout) -
hasTimedOut
boolean hasTimedOut()To validate if the Transaction had previously timed out. This is to check the reason why a TX has been rolled back. -
putProperty
-
getProperty
-
isContainsPersistent
boolean isContainsPersistent() -
setContainsPersistent
void setContainsPersistent() -
setTimeout
void setTimeout(int timeout) -
createRefsOperation
-
isAsync
boolean isAsync() -
setAsync
To be used on control transactions that are meant as internal and don't really require a hard sync. -
isAllowPageTransaction
default boolean isAllowPageTransaction() -
delay
void delay()Calling this will defer the storage of the commit or prepare until delayDone is called. -
delayDone
void delayDone()This is to be called when the delay portion is done.
-