Java Transaction Api

The Java Transaction API is one of the J2EE APIs allowing distributed transactions to be done across multiple XA resources. It provides for:
  • demarcation of transaction boundaries
  • X/Open XA API allowing resources to participate in transactions.

X/Open XA architecture

In the X/Open XA architecture, a transaction manager or transaction processing monitor (TP monitor), coordinates the transactions across multiple resources such as a database. Each resource has its own manager. The resource manager typically has its own API for manipulating the resource, for example the JDBC API used by relational databases. In addition, the resource manager allows a TP monitor to coordinate a distributed transaction between it and other resource managers. Finally, there is the application which communicates with the TP monitor to begin, commit or rollback the transactions. The application also communicates with the individual resources using their own API to modify the resource.

JTA implementation of the X/Open XA Architecture

The JTA API is modelled on the X/Open XA architecure, but it defines two different APIs for demarcating transaction bounderies. It distinguishes between an application server such as an EJB server and an application component. It provides a class, javax.transaction.TransactionManager, that is used by the application server itself to begin, commit and rollback the transactions. It provides a different class, the javax.transaction.UserTransaction, that is used by general client code such as a servlet or an EJB to manage the transactions. Below is a diagram showing the JTA classes used for the X/Open XA interfaces:
The JTA architecture requires that each resource manager must implement the javax.transaction.xa.XAResource interface in order to be managed by the TP monitor. As stated previously, each resource will have its own specific API, for instance:
  • relational databases use JDBC
  • messaging services use JMS
  • generalized EIS (Enterprise Information System) resources use J2EE connector API.

Examples

Transaction Management in a Simple Application

Transaction Management in an EJB

Additional Resources

 

<< PreviousWord BrowserNext >>
nelly furtado
do it yourself
boer war
mary elizabeth braddon
guar
lady audley's secret
cephalopod
fluoxetine
signal reflection
emory university
transcendental meditation
voc
dutch east india company
bubble fusion
municipal art society
new york city arts organizations
imperial capital bank
los angeles pierce college
los angeles community college district
calvary cathedral international
enterprise java beans
j. michael straczynski
sonoluminescence
university of cologne
java database connectivity
murasaki shikibu
history of belarus
java naming and directory interface
hagia sophia
chastity bono
climbing wall
old church slavonic
299
298
297
nordic council
388
387
386
384
383
382
history of estonia
380