I am currently stuck with configuring JBoss XA Transaction support on JBoss 6.1. My set up has multiple data sources, and I want to have XA Transactions aross them. Most notably, Message Driven Bean pulls a message off the queue, process it which will write to database. Now if there is an exception, I want the entire operation to rollback, the message should be redelivered for retry, if the operation failed too many times, the message will go to Dead Letter Queue.
I have configured my datasources to be XA transaction. However, when an exception occurred on MDB, the operation did not rollback. The log is as follows:
14:43:18,511 WARN [com.arjuna.ats.jta] ARJUNA-16038 No XAResource to recover < formatId=131076, gtrid_length=29, bqual_length=28, tx_uid=0:ffff7f000101:126a:4f3b51f8:17, node_name=1, branch_uid=0:ffff7f000101:126a:4f3b51f8:25, eis_name=unknown eis name >
14:43:18,535 WARN [com.arjuna.ats.jta] ARJUNA-16037 Could not find new XAResource to use for recovering non-serializable XAResource < formatId=131076, gtrid_length=29, bqual_length=28, tx_uid=0:ffff7f000101:126a:4f3b45c9:16, node_name=1, branch_uid=0:ffff7f000101:126a:4f3b45c9:18, eis_name=unknown eis name >
From the log, it seems I need to register XAResourceRecovery to my XAResource. I have been searching on the web for hours maybe days, but couldn't find a complete documentation on how to do this.
If you have come across this before, please shed some light. Thank you very much for your help.
I found out that my MDB's transaction annotation was wrong. I specified TransactionAttributeType.REQUIRES_NEW instead of TransactionAttributeType.REQUIRED. I also review all my datasources to make sure they are XA transactions. The transactions work as expected now, that is when an exception occurred, the transaction will rollback and retry.