tyrex.tm

Interface TyrexTransaction

public interface TyrexTransaction extends 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
voidasyncCommit()
Perform an asynchronous commit on the transaction.
voidasyncRollback()
Perform an asynchronous rollback on the transaction.
booleancanUseOnePhaseCommit()
Return true if the transaction can be safely committed using one-phase commit.
ControlgetControl()
Returns the control interface of the underlying transaction.
TransactiongetParent()
Returns the parent of this transaction.
longgetStarted()
Returns the start time of the tranasction.
longgetTimeout()
Returns the timeout for the tranasction.
TransactiongetTopLevel()
Returns the top level parent of this transaction, or this transaction if this is a top level transaction.
XidgetXid()
Returns the Xid of the transaction.
voidonePhaseCommit()
Perform one-phase commit on the transaction.
voidsetTransactionTimeout(int seconds)
Change the timeout for the transaction to the new value.

Method Detail

asyncCommit

public void asyncCommit()
Perform an asynchronous commit on the transaction.

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

asyncRollback

public void asyncRollback()
Perform an asynchronous rollback on the transaction.

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

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

getControl

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

Returns: The control interface

getParent

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

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

getStarted

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

Returns: The start time of the tranasction

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

getTopLevel

public 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

getXid

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

Returns: The Xid of the transaction

onePhaseCommit

public void onePhaseCommit()
Perform one-phase commit on the transaction.

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

setTransactionTimeout

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

Parameters: seconds The new timeout in seconds

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.