Class GeronimoUserTransaction

java.lang.Object
org.apache.geronimo.transaction.GeronimoUserTransaction
All Implemented Interfaces:
Serializable, javax.transaction.UserTransaction

public final class GeronimoUserTransaction extends Object implements javax.transaction.UserTransaction, Serializable
See Also:
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    void
    Create a new transaction and associate it with the current thread.
    void
    Complete the transaction associated with the current thread.
    int
    Obtain the status of the transaction associated with the current thread.
    void
    Roll back the transaction associated with the current thread.
    void
    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 Details

    • GeronimoUserTransaction

      public GeronimoUserTransaction(javax.transaction.TransactionManager transactionManager)
  • Method Details

    • 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 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:
      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, IllegalStateException, javax.transaction.RollbackException, 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.
      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.
      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 IllegalStateException, 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:
      IllegalStateException - Thrown if the current thread is not associated with a transaction.
      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.