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.

Modify the foreign JMSConnectionFactory in WebLogic to point to a XAConnectionFactory.

In the web browser, load the page, http://<machineName>:7001/examplesWebApp/index.jsp. Click on the Administration Console link. Enter weblogic as the Username and Password and click Sign In.

  1. In the left pane, select examples->services->JMS->Foreign JMS Servers->TIBCO JMSServer->Foreign JMSConnectionFactories->TIBCO JMSTopicConnectionFactory.
  2. In the right pane, replace the contents of the Local JNDI Name box with TIBCO.xatcf and the contents of the Remote JNDI Name box with XATopicConnectionFactory. Click Apply.

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 selecting Start->Programs->TIBCO Enterprise Message Service 4.3->Start EMS Administration Tool from the Windows Start menu.
  2. Enter the following commands:
  3.    > 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, within the <ejb-jar> descriptor, after the <enterprise-beans> descriptor:
  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 the element <connection-factory-jndi-name> in the file weblogic-ejb-jar.xml. To use a message driven bean with container managed transactions, it should use a JMS connection factory that supports XA. Change the value of the element <connection-factory-jndi-name> to TIBCO.xatcf.
  4. 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