Class TransactionImpl

  • All Implemented Interfaces:
    TransactionInternal, jakarta.transaction.Transaction

    public class TransactionImpl
    extends Object
    implements TransactionInternal
    An implementation of jakarta.transaction.Transaction using JTS XXX TODO should catch all org.omg.CORBA.SystemException and throw jakarta.transaction.SystemException
    Author:
    Tony Ng
    • Constructor Detail

      • TransactionImpl

        public TransactionImpl​(org.omg.CosTransactions.Control control,
                               GlobalTID gtid)
                        throws jakarta.transaction.SystemException
        Throws:
        jakarta.transaction.SystemException
    • Method Detail

      • commit

        public void commit()
                    throws jakarta.transaction.HeuristicMixedException,
                           jakarta.transaction.RollbackException,
                           jakarta.transaction.HeuristicRollbackException,
                           IllegalStateException,
                           SecurityException,
                           jakarta.transaction.SystemException
        Complete the transaction represented by this Transaction object
        Specified by:
        commit in interface jakarta.transaction.Transaction
        Throws:
        jakarta.transaction.HeuristicMixedException
        jakarta.transaction.RollbackException
        jakarta.transaction.HeuristicRollbackException
        IllegalStateException
        SecurityException
        jakarta.transaction.SystemException
      • rollback

        public void rollback()
                      throws IllegalStateException,
                             jakarta.transaction.SystemException
        Rollback the transaction represented by this Transaction object.
        Specified by:
        rollback in interface jakarta.transaction.Transaction
        Throws:
        IllegalStateException
        jakarta.transaction.SystemException
      • enlistResource

        public boolean enlistResource​(XAResource res)
                               throws jakarta.transaction.RollbackException,
                                      IllegalStateException,
                                      jakarta.transaction.SystemException
        enlist a resource with the current transaction If a transaction is marked as rollback, enlistment will succeed if the resource has been enlisted before. Otherwise, enlistment will fail. In both cases, a RollbackException will be thrown.
        Specified by:
        enlistResource in interface jakarta.transaction.Transaction
        Throws:
        jakarta.transaction.RollbackException
        IllegalStateException
        jakarta.transaction.SystemException
      • delistResource

        public boolean delistResource​(XAResource res,
                                      int flags)
                               throws IllegalStateException,
                                      jakarta.transaction.SystemException
        Specified by:
        delistResource in interface jakarta.transaction.Transaction
        Throws:
        IllegalStateException
        jakarta.transaction.SystemException
      • getStatus

        public int getStatus()
                      throws jakarta.transaction.SystemException
        Specified by:
        getStatus in interface jakarta.transaction.Transaction
        Throws:
        jakarta.transaction.SystemException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • registerSynchronization

        public void registerSynchronization​(jakarta.transaction.Synchronization sync)
                                     throws jakarta.transaction.RollbackException,
                                            IllegalStateException,
                                            jakarta.transaction.SystemException
        Specified by:
        registerSynchronization in interface jakarta.transaction.Transaction
        Throws:
        jakarta.transaction.RollbackException
        IllegalStateException
        jakarta.transaction.SystemException
      • registerInterposedSynchronization

        public void registerInterposedSynchronization​(jakarta.transaction.Synchronization sync)
                                               throws jakarta.transaction.RollbackException,
                                                      IllegalStateException,
                                                      jakarta.transaction.SystemException
        Description copied from interface: TransactionInternal
        Register a Synchronization instance with special ordering semantics.
        Specified by:
        registerInterposedSynchronization in interface TransactionInternal
        Parameters:
        sync - - the Synchronization instance.
        Throws:
        jakarta.transaction.RollbackException
        IllegalStateException
        jakarta.transaction.SystemException
        See Also:
        TransactionSynchronizationRegistry.registerInterposedSynchronization(Synchronization)
      • setRollbackOnly

        public void setRollbackOnly()
                             throws IllegalStateException,
                                    jakarta.transaction.SystemException
        Specified by:
        setRollbackOnly in interface jakarta.transaction.Transaction
        Throws:
        IllegalStateException
        jakarta.transaction.SystemException
      • getTransactionId

        public String getTransactionId()
      • getStartTime

        public long getStartTime()