com.metamatrix.common.transaction
Interface UserTransaction

All Known Implementing Classes:
ConfigurationPropertiedObjectEditor, FakeUserTransaction, ResourcePropertiedObjectEditor, SimpleUserTransaction

public interface UserTransaction


Method Summary
 void begin()
          Create a new transaction and associate it with this object.
 void commit()
          Complete the transaction associated with this object.
 java.lang.Object getSource()
          Return the (optional) reference to the object that is considered the source of the transaction represented by this object.
 int getStatus()
          Obtain the status of the transaction represented by this object.
 void rollback()
          Roll back the transaction associated with this object.
 void setRollbackOnly()
          Modify the transaction associated with this object such that the only possible outcome of the transaction is to roll back the transaction.
 void setTransactionTimeout(int seconds)
          Modify the value of the timeout value that is associated with the transactions represented by this object.
 

Method Detail

getStatus

int getStatus()
              throws TransactionException
Obtain the status of the transaction represented by this object.

Returns:
The transaction status.
Throws:
TransactionException

begin

void begin()
           throws TransactionException
Create a new transaction and associate it with this object.

Throws:
TransactionNotSupportedException - if the current thread is already associated with a transaction and the manager does not support nested system transactions.
TransactionException

setTransactionTimeout

void setTransactionTimeout(int seconds)
                           throws TransactionException
Modify the value of the timeout value that is associated with the transactions represented by this object. If an application has not called this method, the transaction service uses some default value for the transaction timeout.

Parameters:
seconds - The value of the timeout in seconds. If the value is zero, the transaction service restores the default value.
Throws:
java.lang.IllegalStateException - Thrown if this object is not associated with a transaction
TransactionException

setRollbackOnly

void setRollbackOnly()
                     throws TransactionException
Modify the transaction associated with this object such that the only possible outcome of the transaction is to roll back the transaction.

Throws:
java.lang.IllegalStateException - Thrown if this object is not associated with a transaction.
TransactionException

commit

void commit()
            throws TransactionException
Complete the transaction associated with this object. When this method completes, the thread becomes associated with no transaction.

Throws:
java.lang.IllegalStateException - Thrown if this object is not associated with a transaction.
TransactionException

rollback

void rollback()
              throws TransactionException
Roll back the transaction associated with this object. When this method completes, the thread becomes associated with no transaction.

Throws:
java.lang.IllegalStateException - Thrown if this object is not associated with a transaction.
TransactionException

getSource

java.lang.Object getSource()
                           throws TransactionException
Return the (optional) reference to the object that is considered the source of the transaction represented by this object. This is used, for example, to set the source of all events occuring within this transaction.

Returns:
the source object, which may be null
Throws:
TransactionException


Copyright © 2009. All Rights Reserved.