Class MicroTxUserTransactionService

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

@Service @RequestScope public class MicroTxUserTransactionService extends MicroTxUserTransaction
Extends the MicroTxUserTransaction and define the methods to manage the User Transaction
  • Constructor Details

    • MicroTxUserTransactionService

      public MicroTxUserTransactionService()
  • Method Details

    • begin

      public void begin() throws jakarta.transaction.NotSupportedException, jakarta.transaction.SystemException
      xa_begin call. This method defines the start of XA transaction boundary
      Throws:
      jakarta.transaction.NotSupportedException
      jakarta.transaction.SystemException
    • begin

      public void begin(boolean enlist) throws jakarta.transaction.NotSupportedException, jakarta.transaction.SystemException
      Throws:
      jakarta.transaction.NotSupportedException
      jakarta.transaction.SystemException
    • commit

      public void commit() throws jakarta.transaction.RollbackException, jakarta.transaction.HeuristicMixedException, jakarta.transaction.HeuristicRollbackException, SecurityException, IllegalStateException, jakarta.transaction.SystemException
      Commit the current XA Transaction. Microtx Coordinator will handle commit of the ongoing XA Transaction.
      Throws:
      jakarta.transaction.NotSupportedException
      jakarta.transaction.SystemException
      jakarta.transaction.RollbackException
      jakarta.transaction.HeuristicMixedException
      SecurityException
      jakarta.transaction.HeuristicRollbackException
      IllegalStateException
    • rollback

      public void rollback() throws IllegalStateException, SecurityException, jakarta.transaction.SystemException
      Rollback the current XA Transaction. Microtx Coordinator will handle rollback of the ongoing XA Transaction.
      Throws:
      jakarta.transaction.NotSupportedException
      jakarta.transaction.SystemException
      jakarta.transaction.RollbackException
      jakarta.transaction.HeuristicMixedException
      SecurityException
      IllegalStateException
    • getStatus

      public int getStatus() throws jakarta.transaction.SystemException
      Get the current state of the XA Transaction.
      Throws:
      jakarta.transaction.SystemException - If the MicroTx Coordinator is providing http status other than ok.
    • startTCSGlobalTransaction

      public void startTCSGlobalTransaction() throws IllegalStateException, jakarta.transaction.SystemException
      Starts the XA transaction.
      Specified by:
      startTCSGlobalTransaction in class MicroTxUserTransaction
      Throws:
      IllegalStateException - If the current thread is not associated with a transaction.
      jakarta.transaction.SystemException - If the MicroTx Coordinator is not available or active.
    • suspend

      public 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.
      Specified by:
      suspend in class MicroTxUserTransaction
      Throws:
      IllegalStateException - If the current thread is not associated with a transaction.
    • resume

      public 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.
      Specified by:
      resume in class MicroTxUserTransaction
      Throws:
      IllegalStateException - If the current thread is not associated with a transaction.