NonStop Server for Java 6.0 Programmer's Reference
Table 9 Current Class Methods (continued)
DescriptionMethod
Marks the transaction associated with the calling thread so that the only
possible outcome is to roll back the transaction.
rollback_only
Modifies the time-out value associated with transactions started by subsequent
invocations of the begin method.
set_timeout
Suspends the association of the calling thread with a transaction context.suspend
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 the tandem.com.tmf package description in
the NonStop Server for Java API Reference.
Java Transaction API (JTA)
NonStop Server for Java 6.0 supports transactions by means of the NonStop Server for Java
Transaction API, which is an implementation of the Sun Microsystems JTA Version 1.0. NonStop
Server for Java Transaction API implements parts of the Sun Microsystems JTA package,
javax.transaction. NonStop Server for Java 6.0 includes the NonStop Server for Java
Transaction API package com.tandem.jta.
The NonStop Server for Java Transaction API provides a standard interface for transactions on
both homogeneous NonStop systems by means of TMF and heterogeneous CORBA systems by
means of JTS.
The version of NonStop Server for Java Transaction API that uses TMF is called NonStop Server
for Java Transaction API-TMF; the version of NonStop Server for Java Transaction API that uses JTS
is called NonStop Server for Java Transaction API-JTS. NonStop Server for Java Transaction API-TMF
and NonStop Server for Java Transaction API-JTS have identical interfaces. You can specify TMF
or JTS when you use JTAFactory.getUserTransaction to get a reference to
javax.transaction.UserTransaction. (See “Examples” (page 74)). The default is TMF.
NonStop Server for Java Transaction API-TMF is intended for applications other than CORBA
applications. NonStop Server for Java Transaction API-JTA is intended for CORBA applications. If
you use NonStop Server for Java Transaction API-JTS for non-CORBA applications, results are
unpredictable.
This subsection explains the following subjects:
• “javax.transaction Interfaces” (page 74)
• “javax.transaction Exceptions” (page 74)
• “Examples” (page 74)
For more information about JTA, see the Sun Microsystems JTA document
(http://java.sun.com/products/jta/index.html).
Java Transaction API (JTA) 73










