Class MicroTxUserTransaction

java.lang.Object
com.oracle.microtx.xa.rm.MicroTxUserTransaction
All Implemented Interfaces:
jakarta.transaction.UserTransaction
Direct Known Subclasses:
MicroTxUserTransactionService

public abstract class MicroTxUserTransaction extends Object implements jakarta.transaction.UserTransaction
The MicroTx user transaction abstract class defines the methods that allow an application to explicitly manage transaction boundaries.
  • Field Details

    • gtrid

      public String gtrid
    • txnUrl

      public String txnUrl
    • txnInternalUrl

      public String txnInternalUrl
    • txnExternalUrl

      public String txnExternalUrl
    • timeout

      protected int timeout
    • rollbackOnly

      protected boolean rollbackOnly
    • suspended

      protected boolean suspended
    • NO_TX_CUR_THREAD

      protected static final String NO_TX_CUR_THREAD
      See Also:
    • insProperties

      protected Map<String,Object> insProperties
    • LOGGER

      protected static final org.slf4j.Logger LOGGER
  • Constructor Details

    • MicroTxUserTransaction

      public MicroTxUserTransaction()
  • Method Details

    • startTCSGlobalTransaction

      public abstract void startTCSGlobalTransaction() throws IllegalStateException, jakarta.transaction.SystemException
      Start the transaction with a Unique Identifier. This is intended to ensure that the transaction is globally identifiable.
      Throws:
      jakarta.transaction.SystemException
      IllegalStateException - .
    • suspend

      public abstract void suspend() throws IllegalStateException
      Suspend the transaction. This affects only the local transaction state. This is intended to ensure that the client filters for outgoing requests do not perform transaction.
      Throws:
      IllegalStateException - If the current thread is not associated with a transaction.
    • resume

      public abstract void resume() throws IllegalStateException
      Resume the transaction. This affects only the local transaction state. This is intended to ensure that the client filters for outgoing requests starts performing transaction specific operations again.
      Throws:
      IllegalStateException - If the current thread is not associated with a transaction.
    • setRollbackOnly

      public void setRollbackOnly() throws IllegalStateException
      Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
      Specified by:
      setRollbackOnly in interface jakarta.transaction.UserTransaction
      Throws:
      IllegalStateException - If the current thread is not associated with a transaction.
    • setTransactionTimeout

      public void setTransactionTimeout(int timeout)
      Modify the timeout value that is associated with transactions started by the current thread with the begin method. If an application has not called this method, the transaction service uses some default value for the transaction timeout.
      Specified by:
      setTransactionTimeout in interface jakarta.transaction.UserTransaction
      Parameters:
      timeout - The value of the timeout in seconds. If the value is zero, the transaction service restores the default value. If the value is negative a SystemException is thrown.
    • getTransactionTimeout

      public int getTransactionTimeout()
    • getTxnInternalUrl

      public String getTxnInternalUrl() throws IllegalStateException
      Throws:
      IllegalStateException
    • getTxnExternalUrl

      public String getTxnExternalUrl() throws IllegalStateException
      Throws:
      IllegalStateException
    • getTxnUrl

      public String getTxnUrl() throws IllegalStateException
      Throws:
      IllegalStateException
    • setProperty

      public void setProperty(String propertyName, Object propertyValue)
    • getTransactionID

      public String getTransactionID() throws IllegalStateException
      Get OTMM(MicroTx) user transaction ID associated with the current thread
      Returns:
      returns the GTRID.
      Throws:
      IllegalStateException - If the current UserTransaction instance/object has not been used to begin a transaction
    • getInsProperties

      public Map<String,Object> getInsProperties()
    • setInsProperties

      public void setInsProperties(Map<String,Object> insProperties)