Current class methods

The Current class is based on version 0.5 of the Java Transaction Services (JTS) specification.

Table 9: Current Class methods

Method

Description

begin

Starts a new transaction and associates it with the calling thread.

commit

Commits the transaction associated with the calling thread.

get_control

Gets a

Control

object representing the transaction associated with the calling thread.

get_status

Gets the status of the transaction associated with the calling thread.

get_transaction_name

Gets a descriptive name of the transaction associated with the calling thread.

resume

Sets or resumes association of a transaction with the calling thread.

rollback

Rolls back the transaction associated with the calling thread.

rollback_only

Marks the transaction associated with the calling thread so that the only possible outcome is to roll back the transaction.

set_timeout

Modifies the time-out value associated with transactions started by subsequent invocations of the

begin

method.

suspend

Suspends the association of the calling thread with a transaction context.

The following code fragment shows how to use the begin() and commit() methods of the Current class:

import com.tandem.tmf.Current;

Current tx = new Current();

// start a new transaction in the current thread
tx.begin();
// ... access Pathway server

// commit current transaction (JDBC and Pathway)
tx.commit(true);

For more information on the Current class, see com.tandem.tmf package description in the JToolkit for Java API Reference Pages.