bea.jolt
Class JoltTransaction

java.lang.Object
  bea.jolt.Transaction
      bea.jolt.JoltTransaction

public class JoltTransaction
extends bea.jolt.Transaction

The JoltTransaction class is the explicit transaction model for Jolt. The JoltTransaction class implements the transaction object. This object can be used by JoltRemoteService to include several services into a single transaction. When a transaction times out, your application must roll back the transaction immediately. In the current implementation of Tuxedo, only one transaction object can be instantiated at one time.

See Also:
JoltRemoteService, JoltSession

Constructor Summary
JoltTransaction(int timeout, Session session)
          The constructor (or the method that is invoked automatically when a new instance of a class is created) implies the beginning of the transaction.
JoltTransaction(int timeout, Session session, java.lang.String principal, java.lang.String realm)
           
 
Method Summary
 void commit()
          Commit the transaction.
 Session getSession()
          Get the session associated with this transaction.
 void rollback()
          Roll back or abort the transaction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JoltTransaction

public JoltTransaction(int timeout,
                       Session session)
                throws TransactionException
The constructor (or the method that is invoked automatically when a new instance of a class is created) implies the beginning of the transaction. The session parameter in the constructor ensures that the transaction does not span over multiple sessions. The current Jolt release allows only one transaction per session. The JoltTransaction constructor requires that you set the timeout for a transaction. Specifying a timeout parameter of zero sets the timeout to the maximum value for the system. If the transaction is not completed within this period of time (the time between the tpbegin() and the tpcommit()), then Jolt generates a TransactionException. The RECVTIMEOUT for each transactional JoltRemoteService.call() is automatically adjusted to the proper timeout value.

Parameters:
timeout - A suggested transaction timeout value in seconds
session - The session which the transaction belongs to
Throws:
TransactionException - Another transaction is already in progress, or invalid session object
See Also:
JoltSession, JoltRemoteService.call(bea.jolt.Transaction)

JoltTransaction

public JoltTransaction(int timeout,
                       Session session,
                       java.lang.String principal,
                       java.lang.String realm)
                throws TransactionException
Method Detail

getSession

public Session getSession()
Get the session associated with this transaction. If this transaction has been committed or aborted, it returns null.

Returns:
The session object, or null.
See Also:
JoltSession

commit

public void commit()
            throws TransactionException
Commit the transaction. Once the transaction is committed or aborted because of failure (TPEABORT), this transaction is obsolete.

Throws:
TransactionException - A transaction error has occurred.

rollback

public void rollback()
              throws TransactionException
Roll back or abort the transaction. Once the transaction is rolled back, this transaction is obsolete.

Throws:
TransactionException - A transaction error has occurred.