Chapter 29. The javax.transaction.xa PackageThe javax.transaction.xa package represents a Java mapping of certain elements of the X/Open XA interface specification. The XA interface defines a standard two-way communication protocol between a transaction manager and a resource manager, such as a relational database, so that they can engage in distributed transactional processing. These interfaces are used internally by the JTA to implement its transaction management services. Normally, you shouldn't have to use these interfaces directly in application code. Figure 29-1 shows the class hierarchy of the package. Figure 29-1. The javax.transaction.xa package
Thrown by a resource manager when an error occurs while handling a request from the transaction manager. The static error codes allow the transaction manager to determine the cause of the error.
Hierarchy: Object-->Throwable(Serializable)-->Exception-->XAException Thrown By: XAResource.{commit(), end(), forget(), getTransactionTimeout(), isSameRM(), prepare(), recover(), rollback(), setTransactionTimeout(), start()}
The XAResource interface is implemented by shared resources that want to engage in distributed transactions. A single resource manager (e.g., a database server or message service) can export multiple transactional resources (database connections, sessions with a message service), represented as XAResource objects. The transaction manager uses the XAResource interface to associate a resource with a transaction using the start() method, to ask the resource to commit() or rollback() any work done while it was associated with a transaction, and finally to end() the association with a transaction. Other methods on XAResource manage the association of the resource with the transaction context.
Passed To: Transaction.{delistResource(), enlistResource()}, XAResource.isSameRM() Returned By: javax.jms.XASession.getXAResource(), javax.sql.XAConnection.getXAResource()
An Xid is an identifier for a transaction. This interface is used by transaction managers and resource managers as the representation for transactions. The methods on the interface allow these two entities to query for specific components of the transaction identifier.
Passed To: XAResource.{commit(), end(), forget(), prepare(), rollback(), start()} Returned By: XAResource.recover() Copyright © 2001 O'Reilly & Associates. All rights reserved. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|