NonStop Server for Java (NSJ) Programmer's Guide (NSJ 2.0+)
Contents | Index | Glossary | Prev | Next
Transactions
Compaq NonStop
TM
Server for Java
TM
lets you work with transactions in several ways. You can:
Let the original Compaq NonStop
TM
SQL/MP driver define transactions for you.1.
Use the Current class methods with the transaction-aware Compaq NonStop
TM
SQL/MP
driver to define transactions across transaction services, such as transactions that include both
JDBC
TM
and Java-to-Pathway calls.
2.
Use the Current class methods alone to define transactions when accessing a Pathway
server.
3.
Use the Java Transaction API (JTA).4.
This section explains these subjects:
Current Class Methods●
Java Transaction API (JTA)●
For information about using JDBC to access SQL/MP databases, see Accessing NonStop
TM
SQL/MP
Databases. For information about the Java-to-Pathway API, see Accessing Pathway Servers.
Current Class Methods
Use Current class methods in the following situations:
To communicate with a Pathway server that expects the client to begin and end a transaction●
To combine different transaction services, such as JDBC and Pathway, into a single transaction●
The Current class is based on version 0.5 of the Java Transaction Services (JTS) specification.
The following table describes the Current class methods.
Current Class Methods
Method Description
begin()
Starts a new transaction and associates it with the calling thread.
commit(boolean)
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.