Modifying this Example to use Container Managed Transactions and XA


This section describes how to modify the above example to support container-managed transactions. In this modified example, TIBCO Enterprise Message Service server participates in a distributed transaction started by WebLogic server.

Create a JMS Connection factory that supports XA.

To create the JMS Connection factory that supports XA, perform the following:

  1. Start the TIBCO Enterprise Message Service administration tool by running command
  2.  
       tibemsadmin 
    
  3. Enter the following commands
  4.  
       connect 
       create factory XATopicConnectionFactory xatopic 
    

Modifying the Weblogic Deployment files to make MDB to use transactions

  1. Add the following lines to ejb-jar.xml:
  2.  
       <assembly-descriptor> 
          <container-transaction> 
          <method> 
             <ejb-name>exampleMessageDriven1</ejb-name> 
             <method-name>*</method-name> 
          </method> 
          <method> 
             <ejb-name>exampleMessageDriven2</ejb-name> 
             <method-name>*</method-name> 
          </method> 
          <trans-attribute>Required</trans-attribute> 
          </container-transaction> 
       </assembly-descriptor> 
    
  3. Change connection-factory-jndi-name in the file weblogic-ejb-jar.xml. To use a message driven bean with container manager transactions, it should use a JMS connection factory that supports XA. Change connection-factory-jndi-name to XATopicConnectionFactory.

Rebuild, redeploy, and run the example MDB in the same manner as described in the previous sections.


TIBCO Enterprise Message Service™ Application Integration Guide
Software Release 4.3, February 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com