WebSphere MQ class: MQXASession
java.lang.Object | +----com.ibm.mq.jms.MQXASession |
XASession extends the capability of Session by adding access to a JMS provider's support for JTA. This support takes the form of a javax.transaction.xa.XAResource object. The functionality of this object closely resembles that defined by the standard X/Open XA Resource interface.
An application server controls the transactional assignment of an XASession by obtaining its XAResource. It uses the XAResource to assign the session to a transaction, prepare and commit work on the transaction, and so on.
An XAResource provides some fairly sophisticated facilities such as interleaving work on multiple transactions and recovering a list of transactions in progress.
A JTA-aware JMS provider must fully implement this functionality. To do this, a JMS provider could either use the services of a database that supports XA, or implement this functionality from scratch.
A client of the application server is given what appears to be a regular JMS Session. Behind the scenes, the application server controls the transaction management of the underlying XASession.
Refer to Appendix E, JMS JTA/XA interface with WebSphere Application Server V4 for details about how WebSphere MQ JMS uses XA classes.
See also: XAQueueSession and XATopicSession
public void commit() throws JMSException
This method should not be called for an XASession object. If it is called, it throws a TransactionInProgressException.
public boolean getTransacted() throws JMSException
Always returns true.
public javax.transaction.xa.XAResource getXAResource()
Return an XA resource to the caller.
public void rollback() throws JMSException
This method should not be called for an XASession object. If it is called, it throws a TransactionInProgressException.