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

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981738#3981738

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981738
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to