org.openorb.ots.jta
Class UserTransaction

java.lang.Object
  extended by org.openorb.ots.jta.UserTransaction
All Implemented Interfaces:
javax.transaction.UserTransaction

public class UserTransaction
extends java.lang.Object
implements javax.transaction.UserTransaction

This class provides the UserTransaction interface implementation. It transmits all invocations to the transaction manager.

Author:
Jerome Daniel

Constructor Summary
UserTransaction(javax.transaction.TransactionManager manager)
          Constructor
 
Method Summary
 void begin()
          Create a new transaction
 void commit()
          Commit the current transaction
 int getStatus()
          Return the transaction status.
 void rollback()
          Rollback a transaction
 void setRollbackOnly()
          Set the current transaction to be only rolledback
 void setTransactionTimeout(int seconds)
          Set the transaction timeout.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserTransaction

public UserTransaction(javax.transaction.TransactionManager manager)
Constructor

Method Detail

begin

public void begin()
           throws javax.transaction.NotSupportedException,
                  javax.transaction.SystemException
Create a new transaction

Specified by:
begin in interface javax.transaction.UserTransaction
Throws:
javax.transaction.NotSupportedException
javax.transaction.SystemException

commit

public void commit()
            throws javax.transaction.RollbackException,
                   javax.transaction.HeuristicMixedException,
                   javax.transaction.HeuristicRollbackException,
                   java.lang.SecurityException,
                   java.lang.IllegalStateException,
                   javax.transaction.SystemException
Commit the current transaction

Specified by:
commit in interface javax.transaction.UserTransaction
Throws:
javax.transaction.RollbackException
javax.transaction.HeuristicMixedException
javax.transaction.HeuristicRollbackException
java.lang.SecurityException
java.lang.IllegalStateException
javax.transaction.SystemException

getStatus

public int getStatus()
              throws javax.transaction.SystemException
Return the transaction status.

Specified by:
getStatus in interface javax.transaction.UserTransaction
Throws:
javax.transaction.SystemException

rollback

public void rollback()
              throws java.lang.IllegalStateException,
                     java.lang.SecurityException,
                     javax.transaction.SystemException
Rollback a transaction

Specified by:
rollback in interface javax.transaction.UserTransaction
Throws:
java.lang.IllegalStateException
java.lang.SecurityException
javax.transaction.SystemException

setRollbackOnly

public void setRollbackOnly()
                     throws java.lang.IllegalStateException,
                            javax.transaction.SystemException
Set the current transaction to be only rolledback

Specified by:
setRollbackOnly in interface javax.transaction.UserTransaction
Throws:
java.lang.IllegalStateException
javax.transaction.SystemException

setTransactionTimeout

public void setTransactionTimeout(int seconds)
                           throws javax.transaction.SystemException
Set the transaction timeout.

Specified by:
setTransactionTimeout in interface javax.transaction.UserTransaction
Throws:
javax.transaction.SystemException