3 Replies Latest reply on Feb 19, 2007 6:09 AM by Mark Little

    XA transactions not propagating between two JBOSS servers

    Jules Yasuna Newbie

      We are unable to propagate transactions between 2 JBOSS instances

      i am at a loss as to why the transactions are not propagating,
      and I would be very grateful for help from anyone

      here is some information regarding whet we are trying to accomplish,
      and the steps we have taken so far

      our goal is to run two versions of JBOSS on the same host,
      with XA transactions propagated between them. as such, we
      will have to insure there is no overlap in ports used by the
      two JBOSS's

      our test case consists of two stateless session ejb's we
      call Bean_A and Bean_B. a simple client calls a method
      in Bean_A. within this method in Bean_A, a method in Bean_B
      is called (all of this the appropriate JNDI business, of course)
      transaction specification is "Required" an all methods.
      the ejb's use connections from different <xa-datasource> pools,
      which connect to different databases

      and now to the problem. when Bean_A and Bean_B are both
      deployed within the same JBOSS, we see that all operations
      occur under a single transaction. but, when Bean_A and
      Bean_B are deployed in different JBOSS's, the operations
      are do not occur in the same transaction. we determine this
      by looking-up the transaction manager and then logging the
      transaction.toString() like this ...

      final Context context = new InitialContext();
       final TransactionManager transactionManager = (TransactionManager) context.lookup("java:/TransactionManager");
       final Transaction transaction = transactionManager.getTransaction();

      by forcing excpetions to be thrown in Bean_A after is makes the call
      to Bean_B, we further shows that the transactiuons were different
      since Bean_A rollled back, but Bean_B did not roll back.

      we have followed the instructions in the JBOSSTS/Install
      file. in some cases, we have made modifications that were
      not listed in this Install file, but seemed necessary
      when examining the various property/xml files. below are
      steps we took to run two JBOSS's, both using JBOSSTS,
      both running on the same host

      again, any help from anyone would be greatly apprecieated

      software versions
      java 1.4.2_06-b03
      sybase 12.5

      what we did to instrument the JBOSS server with JBOSSTS
      please note that we are working with the DEFAULT server only
      (not the ALL server) so there are some items that must be copied
      from the ALL server to the DEFAULT server

      - copy from JBOSS/server/ALL into JBOSS/server/DEFAULT
      -- JBOSS/server/ALL/deploy/iiop-service.xml --> JBOSS/server/DEFAULT/deploy
      -- JBOSS/server/ALL/conf/jacorb.properties --> JBOSS/server/DEFAULT/conf
      -- JBOSS/server/ALL/lib/jacorb.jar --> JBOSS/server/DEFAULT/lib
      -- JBOSS/server/ALL/lib/jboss-iiop.jar --> JBOSS/server/DEFAULT/lib
      -- JBOSS/server/ALL/lib/avalon-framework.jar --> JBOSS/server/DEFAULT/lib

      - copy from JBOSSTS into JBOSS
      -- JBOSSTS/lib/jbossjts.jar --> JBOSS/server/DEFAULT/lib
      -- JBOSSTS/lib/jbossjts-jacorb.jar --> JBOSS/server/DEFAULT/lib
      -- JBOSSTS/lib/jbossjts-integration.jar --> JBOSS/server/DEFAULT/lib
      -- JBOSSTS/ext/jbossts-common.jar --> JBOSS/server/DEFAULT/lib
      -- JBOSSTS/jacorb/lib/jacorb.jar --> JBOSS/server/DEFAULT/lib
      -- JBOSSTS/jacorb/lib/jacorb.jar --> JBOSS/client
      -- JBOSSTS/etc/jbossjts-properties.xml --> JBOSS/server/DEFAULT/conf

      - modify JBOSS/server/DEFAULT/conf/jbossjts-properties.xml
      -- remove the recovery extension property containing the value

      - modify JBOSS/server/DEFAULT/conf/jboss-service.xml
      -- replace the TransactionManager MBean decalaration with the following ...
      <mbean code="com.arjuna.ats.jbossatx.jts.TransactionManagerService"
       <attribute name="TransactionTimeout">300</attribute>

      - modify JBOSS/server/DEFAULT/conf/jacorb.properties
      -- modify property "jacorb.poa.thread_pool_max"
      to "32"
      -- place the following line at the end of the file

      - modify JBOSS/server/DEFAULT/deploy/iiop-service.xml
      -- remove the following two "initializers"
      -- add the the following one "initializer"

      Additional Steps
      we wish to run two JBOSS's on one host. to this end,
      several files must be modified to insure there are no
      conflicts. the following files/ports must be modified
      to be different between the the two JBOSS's we wish to run

      - modify JBOSS/server/DEFAULT/conf/jbossjts-properties.xml
      -- modify property "com.arjuna.ats.arjuna.xa.nodeIdentifier" to
      insure it has a unique value across all JBOSS instances

      - JBOSS/server/DEFAULT/conf/jacorb.properites
      -- modify property "jacorb.implname"
      insure it has a different unique value in both JBOSS's
      -- modify the property "OAPort" (3528 changed)
      insure it has a different unique value in both JBOSS's
      -- modify property "ORBInitRef.NameService"
      must be consistent with the change made to property "OAPort"

      - JBOSS/server/DEFAULT/jboss-service.xml
      insure all ports are unique and different in both JBOSS's
      -- WebService (8083 changed)
      -- NamingService (1099 changed)
      -- NamingService (1098 changed)
      -- JRMPInvoker (4444 changed )
      -- PooledInvoker (4445 changed)
      -- WebService (8083 changed )

      - JBOSS/server/DEFAULT/deploy/jms/uil2-service.xml
      insure all ports are unique and different in both JBOSS's
      -- UILServerILService (8093 changed)

      - JBOSS/server/DEFAULT/deploy/jbossweb-tomcat55.sar/server.xml
      insure all ports are unique and different in both JBOSS's
      -- HTTP connector (8080 changed)
      -- AJP connector (8009 changed)

      - JBOSS/server/DEFAULT/deploy/jbossws14.sar/jbossws.beans/META-INF/jboss-beans.xml
      -- modify webServicePort (8080 changed)
      must be consistent with tomcat changes

      For Completeness
      we also tried all of the above using CONTEXT instead of INTERPOSITION

      - modify JBOSS/server/DEFAULT/conf/jbossjts-properties.xml
      -- modify property "com.arjuna.ats.jts.contextPropMode"
      set to "CONTEXT"
      -- modify property "com.arjuna.ats.jts.alwaysPropagateContext"
      set to "YES"

      but this had no effect - transactions still did not propagate
      between JBOSS's