tyrex.tm
Interface TyrexTransaction

All Superinterfaces:
javax.transaction.Transaction

public interface TyrexTransaction
extends javax.transaction.Transaction

Tyrex extensions for Transaction. All Tyrex transactions implement this interface which supports asynchronous commit and rollback, and one phase commit.

Author:
Riad Mohammed

Method Summary
 void asyncCommit()
          Perform an asynchronous commit on the transaction.
 void asyncRollback()
          Perform an asynchronous rollback on the transaction.
 boolean canUseOnePhaseCommit()
          Return true if the transaction can be safely committed using one-phase commit.
 org.omg.CosTransactions.Control getControl()
          Returns the control interface of the underlying transaction.
 javax.transaction.Transaction getParent()
          Returns the parent of this transaction.
 long getStarted()
          Returns the start time of the tranasction.
 long getTimeout()
          Returns the timeout for the tranasction.
 javax.transaction.Transaction getTopLevel()
          Returns the top level parent of this transaction, or this transaction if this is a top level transaction.
 javax.transaction.xa.Xid getXid()
          Returns the Xid of the transaction.
 void onePhaseCommit()
          Perform one-phase commit on the transaction.
 void setTransactionTimeout(int seconds)
          Change the timeout for the transaction to the new value.
 
Methods inherited from interface javax.transaction.Transaction
commit, delistResource, enlistResource, getStatus, registerSynchronization, rollback, setRollbackOnly
 

Method Detail

asyncCommit

public void asyncCommit()
                 throws javax.transaction.SystemException,
                        java.lang.SecurityException,
                        javax.transaction.RollbackException
Perform an asynchronous commit on the transaction.

Throws:
javax.transaction.SystemException - A problem occured while associating the transaction with the new thread.
java.lang.SecurityException - The current thread is not allowed to rollback the transaction
javax.transaction.RollbackException - The transaction has been marked for rollback

asyncRollback

public void asyncRollback()
                   throws java.lang.IllegalStateException,
                          javax.transaction.SystemException,
                          java.lang.SecurityException
Perform an asynchronous rollback on the transaction.

Throws:
java.lang.IllegalStateException - The transaction is not in the proper state to be rolled back
javax.transaction.SystemException - A problem occured while associating the transaction with the new thread.
java.lang.SecurityException - The current thread is not allowed to rollback the transaction.

setTransactionTimeout

public void setTransactionTimeout(int seconds)
Change the timeout for the transaction to the new value.

Parameters:
seconds - The new timeout in seconds

canUseOnePhaseCommit

public boolean canUseOnePhaseCommit()
Return true if the transaction can be safely committed using one-phase commit.

Returns:
True if the transaction can be safely committed using one-phase commit

onePhaseCommit

public void onePhaseCommit()
                    throws javax.transaction.RollbackException,
                           javax.transaction.HeuristicMixedException,
                           javax.transaction.HeuristicRollbackException,
                           java.lang.SecurityException,
                           java.lang.IllegalStateException,
                           javax.transaction.SystemException
Perform one-phase commit on the transaction.

Throws:
javax.transaction.RollbackException - Indicates that the transaction has been rolled back rather than committed.
javax.transaction.HeuristicMixedException - A heuristic decision was made and that some relevant updates have been committed while others have been rolled back.
javax.transaction.HeuristicRollbackException - A heuristic decision was made and that some relevant updates have been rolled back.
java.lang.SecurityException - The thread is not allowed to commit the transaction.
java.lang.IllegalStateException - The current thread is not associated with a transaction.
javax.transaction.SystemException - The transaction manager encountered an unexpected error condition

getParent

public javax.transaction.Transaction getParent()
Returns the parent of this transaction.

Returns:
The parent of this transaction, null if the transaction is top-level

getTopLevel

public javax.transaction.Transaction getTopLevel()
Returns the top level parent of this transaction, or this transaction if this is a top level transaction.

Returns:
The top level transaction

getControl

public org.omg.CosTransactions.Control getControl()
Returns the control interface of the underlying transaction.

Returns:
The control interface

getTimeout

public long getTimeout()
Returns the timeout for the tranasction. This is the system clock at which the transaction will time out.

Returns:
The timeout for the tranasction

getStarted

public long getStarted()
Returns the start time of the tranasction.

Returns:
The start time of the tranasction

getXid

public javax.transaction.xa.Xid getXid()
Returns the Xid of the transaction.

Returns:
The Xid of the transaction


Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.