Product SiteDocumentation Site

Chapter 2. Transactions

2.1. The Java Transaction API (JTA)
2.2. Introducing the API
2.3. UserTransaction
2.4. TransactionManager
2.5. Suspend and resuming a transaction
2.6. The Transaction interface
2.7. Resource enlistment
2.8. Transaction synchronization
2.9. Transaction equality
2.10. TransactionSynchronizationRegistry
A transaction is a unit of work that encapsulates multiple database actions such that that either all the encapsulated actions fail or all succeed.
Transactions ensure data integrity when an application interacts with multiple datasources.

2.1. The Java Transaction API (JTA)

The interfaces specified by the many transaction standards tend to be too low-level for most application programmers. Therefore, Sun Microsystems created the Java Transaction API (JTA), which specifies higher-level interfaces to assist in the development of distributed transactional applications.
Note, these interfaces are still low-level. You still need to implement state management and concurrency for transactional applications. The interfaces are also optimized for applications which require XA resource integration capabilities, rather than the more general resources which other transactional APIs allow.
With reference to JTA 1.1 ( http://www.oracle.com/technetwork/java/javaee/tech/jta-138684.html ), distributed transaction services typically involve a number of participants:
application server
provides the infrastructure required to support the application run-time environment which includes transaction state management, such as an EJB server.
transaction manager
provides the services and management functions required to support transaction demarcation, transactional resource management, synchronization, and transaction context propagation.
resource manager
Using a resource adapter , provides the application with access to resources. The resource manager participates in distributed transactions by implementing a transaction resource interface used by the transaction manager to communicate transaction association, transaction completion and recovery.
A resource adapter is used by an application server or client to connect to a Resource Manager. JDBC drivers which are used to connect to relational databases are examples of Resource Adapters.
communication resource manager
supports transaction context propagation and access to the transaction service for incoming and outgoing requests.
From the point of view of the transaction manager, the actual implementation of the transaction services does not need to be exposed. You only need to define high-level interfaces to allow transaction demarcation, resource enlistment, synchronization and recovery process to be driven from the users of the transaction services. The JTA is a high-level application interface that allows a transactional application to demarcate transaction boundaries, and also contains a mapping of the X/Open XA protocol.

Compatibility

the JTA support provided by JBoss Transactions is compliant with the 1.1 specification.