Show TOC

JTA ImplementationLocate this document in the navigation structure

Use

The Java Transaction API (JTA) implementation is one of the modules that make up the Transaction Service together with the Java Transaction Service (JTS) implementation.

JTS enables transaction propagation and interoperability using the Internet Inter-ORB Protocol (IIOP). JTA is the standard API that allows the applications to make use of the transaction services in the application server. In addition, JTA provides an interface for managing the underlying JTS implementation.

The JTA implementation in AS Java provides the basic logic for transaction management. It controls the start and execution of transactions, as well as the processes for enlisting and delisting resources.

Integration

This component is used directly by the EJB Container and Connector Container services, which need the transaction management functions it provides so that the components deployed in them function properly.

Features

The JTA implementation comprises the following elements:

  • Implementation of javax.transaction.TransactionManager interface

    The transaction manager controls the transaction demarcation of transactions associated with a thread context.

    SAP NetWeaver Application Server for Java provides extended access to transactions by allowing applications and frameworks to access the TransactionManager interface directly. You can look up the TransactionManager from all application components in the following way:

                      TransactionManager tm = (TransactionManager)(new InitialContext()).lookup("TransactionManager");
                   

    The TransactionManager interface provides the same methods as the UserTransaction interface, which is described below. Additionally, the TransactionManager enables you to suspend or resume transactions. You can also access the transactions that are associated with the current thread context.

    Recommendation

    To access transactions that are associated with the current thread context, we recommend that you use the methods provided by the TransactionSynchronizationRegistry interface - getTransactionKey and registerInterposedSynchronization .

    For more information about these methods, refer to the TransactionSynchronizationRegistry JavaDoc at http://java.sun.com .

  • Implementation of javax.transaction.UserTransaction interface

    The UserTransaction interface can be used to control the transaction demarcation for the component you develop and deploy.

    More information: Using Component-Managed JTA Transactions

  • Extension of javax.transaction.Transaction interface

    This element provides functions for performing operations on the transaction object, such as committing and rolling back the transaction, enlisting and delisting resources, and so on. The implementation of this interface enables the enlistment of one or more XA resources and zero or one local resources.

  • Implementation of javax.transaction.TransactionSynchronizationRegistry interface

    The Transaction Synchronization Registry interface provides Enterprise Java Beans (EJBs), Web application components, persistence managers, and resource adapters with the abilities to:

    • associate resources with ongoing transactions

    • register synchronization objects according to specific ordering semantics

    • obtain the transaction context and status of ongoing transactions

    • mark these transactions for rollback

    More information: Transaction Synchronization Registry

For more information about these interfaces, refer to the Java Transaction API documentation at http://java.sun.com .

More Information