NonStop Server for Java 6.0 Programmer's Reference
5 Transactions
The NonStop Server for Java 6.0 lets you work with transactions in several ways. You can:
• Use the Current class methods to define transactions across transaction services, such as
transactions that include JDBC calls.
• Use the Java Transaction API (JTA) .
This section explains these topics:
• “Controlling Maximum Concurrent Transactions” (page 72)
• “Current Class Methods” (page 72)
• “Java Transaction API (JTA)” (page 73)
If you use JNI and transactions, see “Java Native Interface (JNI)” (page 43). When you use JNI,
the information under “Controlling Maximum Concurrent Transactions” (page 72) applies.
Controlling Maximum Concurrent Transactions
NonStop Server for Java 6.0 application processes can start, by default, a maximum of 1000
concurrent transactions in each process. By setting the JAVA_PTHREAD_MAX_TRANSACTIONS
environment variable, you can limit the maximum number of TMF transactions allowed per process
to less than 1000. The syntax follows:
JAVA_PTHREAD_MAX_TRANSACTIONS environment variable
Specifies the maximum number of TMF transactions allowed per process.
Allowed values are 100 through 1000. The default value of 1000 is used when:
• The variable is not set.
• The variable is set to a value less than 100 or to a value greater than 1000.
For example, to specify 200 transactions per process, use the following command.
export JAVA_PTHREAD_MAX_TRANSACTIONS=200
NOTE: The maximum number of concurrent transactions allowed is 1000.
Current Class Methods
The Current class is based on version 0.5 of the Java Transaction Services (JTS) specification.
The following table describes the Current class methods. For the API specification, see the
tandem.com.tmf package description in the NonStop Server for Java API Reference
Table 9 Current Class Methods
DescriptionMethod
Starts a new transaction and associates it with the calling thread .begin
Commits the transaction associated with the calling thread.commit
Gets a Control object representing the transaction associated with the
calling thread.
get_control
Gets the status of the transaction associated with the calling thread.get_status
Gets a descriptive name of the transaction associated with the calling thread.get_transaction_name
Sets or resumes association of a transaction with the calling thread.resume
Rolls back the transaction associated with the calling thread.rollback
72 Transactions










