XASession


public interface XASession
extends Session
Subinterfaces: XAQueueSession and XATopicSession

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 XAResource interface.

An appserver 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 can either use the services of a database that supports XA, or implement this functionality from scratch.

A client of the appserver is given what appears to be a regular JMS Session. Behind the scenes, the appserver 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

 

Methods

commit
public void commit()
             throws JMSException

Do not call this method for an XASession object. If it is called, it throws a TransactionInProgressException.

Specified by:
Commit in the Session interface.

Throws:
TransactionInProgressException if this method is called on an XASession.

getTransacted
public boolean getTransacted()
                       throws JMSException

Always returns true.

Specified by:
getTransacted in the Session interface.

Returns:
True if the session is in transacted mode.

Throws:
JMSException if JMS fails to return the transaction mode because of an internal error in the JMS Provider.

getXAResource
public javax.transaction.xa.XAResource getXAResource() 

Return an XA resource to the caller.

Returns:
an XA resource to the caller.

rollback
public void rollback()
               throws JMSException

Do not call this method for an XASession object. If it is called, it throws a TransactionInProgressException.

Specified by:
Rollback in the session interface.

Throws:
TransactionInProgressException if this method is called on an XASession.

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.