Interface Transaction

All Known Implementing Classes:
BindingsTransactionImpl, TransactionImpl

public interface Transaction
An ActiveMQ Artemis internal transaction
  • Method Details

    • getProtocolData

      Object getProtocolData()
    • setProtocolData

      void setProtocolData(Object data)
      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

      void prepare() throws Exception
      Throws:
      Exception
    • commit

      void commit() throws Exception
      Throws:
      Exception
    • commit

      void commit(boolean onePhase) throws Exception
      Throws:
      Exception
    • rollback

      void rollback() throws Exception
      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

      void setState(Transaction.State state)
    • markAsRollbackOnly

      void markAsRollbackOnly(ActiveMQException exception)
    • getCreateTime

      long getCreateTime()
    • addOperation

      void addOperation(TransactionOperation sync)
    • afterWired

      void afterWired(Runnable runnable)
    • afterStore

      void afterStore(TransactionOperation sync)
      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

      void putProperty(int index, Object property)
    • getProperty

      Object getProperty(int index)
    • isContainsPersistent

      boolean isContainsPersistent()
    • setContainsPersistent

      void setContainsPersistent()
    • setTimeout

      void setTimeout(int timeout)
    • createRefsOperation

      RefsOperation createRefsOperation(Queue queue, AckReason reason)
    • isAsync

      boolean isAsync()
    • setAsync

      Transaction setAsync(boolean async)
      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.