Class GeronimoUserTransaction

  • All Implemented Interfaces:
    java.io.Serializable, javax.transaction.UserTransaction

    public final class GeronimoUserTransaction
    extends java.lang.Object
    implements javax.transaction.UserTransaction, java.io.Serializable
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      GeronimoUserTransaction​(javax.transaction.TransactionManager transactionManager)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void begin()
      Create a new transaction and associate it with the current thread.
      void commit()
      Complete the transaction associated with the current thread.
      int getStatus()
      Obtain the status of the transaction associated with the current thread.
      void rollback()
      Roll back the transaction associated with the current thread.
      void setRollbackOnly()
      Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
      void setTransactionManager​(javax.transaction.TransactionManager transactionManager)  
      void setTransactionTimeout​(int seconds)
      Modify the timeout value that is associated with transactions started by the current thread with the begin method.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GeronimoUserTransaction

        public GeronimoUserTransaction​(javax.transaction.TransactionManager transactionManager)
    • Method Detail

      • setTransactionManager

        public void setTransactionManager​(javax.transaction.TransactionManager transactionManager)
      • getStatus

        public int getStatus()
                      throws javax.transaction.SystemException
        Description copied from interface: javax.transaction.UserTransaction
        Obtain the status of the transaction associated with the current thread.
        Specified by:
        getStatus in interface javax.transaction.UserTransaction
        Returns:
        The transaction status. If no transaction is associated with the current thread, this method returns the Status.NoTransaction value.
        Throws:
        javax.transaction.SystemException - Thrown if the transaction manager encounters an unexpected error condition.
      • setRollbackOnly

        public void setRollbackOnly()
                             throws java.lang.IllegalStateException,
                                    javax.transaction.SystemException
        Description copied from interface: javax.transaction.UserTransaction
        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 javax.transaction.UserTransaction
        Throws:
        java.lang.IllegalStateException - Thrown if the current thread is not associated with a transaction.
        javax.transaction.SystemException - Thrown if the transaction manager encounters an unexpected error condition.
      • setTransactionTimeout

        public void setTransactionTimeout​(int seconds)
                                   throws javax.transaction.SystemException
        Description copied from interface: javax.transaction.UserTransaction
        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 javax.transaction.UserTransaction
        Parameters:
        seconds - 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.
        Throws:
        javax.transaction.SystemException - Thrown if the transaction manager encounters an unexpected error condition.
      • begin

        public void begin()
                   throws javax.transaction.NotSupportedException,
                          javax.transaction.SystemException
        Description copied from interface: javax.transaction.UserTransaction
        Create a new transaction and associate it with the current thread.
        Specified by:
        begin in interface javax.transaction.UserTransaction
        Throws:
        javax.transaction.NotSupportedException - Thrown if the thread is already associated with a transaction and the Transaction Manager implementation does not support nested transactions.
        javax.transaction.SystemException - Thrown if the transaction manager encounters an unexpected error condition.
      • commit

        public void commit()
                    throws javax.transaction.HeuristicMixedException,
                           javax.transaction.HeuristicRollbackException,
                           java.lang.IllegalStateException,
                           javax.transaction.RollbackException,
                           java.lang.SecurityException,
                           javax.transaction.SystemException
        Description copied from interface: javax.transaction.UserTransaction
        Complete the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.
        Specified by:
        commit in interface javax.transaction.UserTransaction
        Throws:
        javax.transaction.HeuristicMixedException - Thrown to indicate that a heuristic decision was made and that some relevant updates have been committed while others have been rolled back.
        javax.transaction.HeuristicRollbackException - Thrown to indicate that a heuristic decision was made and that all relevant updates have been rolled back.
        java.lang.IllegalStateException - Thrown if the current thread is not associated with a transaction.
        javax.transaction.RollbackException - Thrown to indicate that the transaction has been rolled back rather than committed.
        java.lang.SecurityException - Thrown to indicate that the thread is not allowed to commit the transaction.
        javax.transaction.SystemException - Thrown if the transaction manager encounters an unexpected error condition.
      • rollback

        public void rollback()
                      throws java.lang.IllegalStateException,
                             java.lang.SecurityException,
                             javax.transaction.SystemException
        Description copied from interface: javax.transaction.UserTransaction
        Roll back the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.
        Specified by:
        rollback in interface javax.transaction.UserTransaction
        Throws:
        java.lang.IllegalStateException - Thrown if the current thread is not associated with a transaction.
        java.lang.SecurityException - Thrown to indicate that the thread is not allowed to roll back the transaction.
        javax.transaction.SystemException - Thrown if the transaction manager encounters an unexpected error condition.