0 Replies Latest reply on Oct 30, 2006 6:57 AM by me_zeta_me

    JBOSS XA Transaction Not working

    me_zeta_me

      Hi all
      I am getting problems using XA connection, please help

      I am using SessionBeans with container managed transaction. From my ejb code i am getting 2 xa connections. and doing some updates but if one of the updates fails transaction is not rolledback.

      MysqlXADataSource myXa1 = new MysqlXADataSource();
      MysqlXADataSource myXa2 = new MysqlXADataSource();
      myXa1.setUrl("jdbc:mysql://host1:3306/his_db1");
      myXa1.setUser("user1");
      myXa1.setPassword("pass1");

      myXa2.setUrl("jdbc:mysql://host2:3306/db2");
      myXa2.setUser("user2");
      myXa2.setPassword("saras123");


      then enlisting it to the transaction and calling the corresponding update methods.

      tm.getTransaction().enlistResource(myXa1.getXAConnection().getXAResource())
      updateDB1(myXa1.getConnection());
      tm.getTransaction().enlistResource(myXa2.getXAConnection().getXAResource())){
      updateDB2(myXa2.getConnection());


      but if updateDB1() has some exception still updateDB2() the db2 is getthing updated

      am i doing some thing wrong or am i missing some thing

      pleas help

      zeta