Jolttransaction constructor, Jolttransaction methods, Jolttransaction – HP NonStop G-Series User Manual

Page 125

Advertising
background image

public class JoltTransaction
{
public JoltTransaction( int timeout, JoltSession s) throws
TransactionException;
public void commit() throws TransactionException;
public void rollback() throws TransactionException;
}

JoltTransaction Constructor

The JoltTransaction class provides a constructor to create the JoltTransaction object.

JoltTransaction

Creates an instance of the JoltTransaction object with the specified parameters.

You can pass a null to the JoltRemoteService call()

method to call services without defining a JoltTransaction object or to

exclude the services from a transaction.

public JoltTransaction( int timeout, JoltSession s) throws TransactionException;

Usage 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 s (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.

JoltTransaction 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.

Throws

TransactionException

TPEJOLT: Invalid session
TPEJOLT: Connection send error
TPEJOLT: Connection recv error
TPEJOLT: Protocol error

The JoltTransaction constructor generates an exception upon receipt of the following TUXEDO errors:

tpbegin()

TPEINVAL, TPETRAN, TPEPROTO, TPESYSTEM, TPEOS

Refer to

TUXEDO Errors

or tperrno in the TUXEDO System Reference Manual for explanations of these error

messages.

JoltTransaction Methods

The JoltTransaction methods provide the means to start or end a transaction process. The following methods handle
commit and rollback transaction processing for the JoltTransaction class.

Advertising