0 Replies Latest reply on Mar 18, 2010 6:59 AM by Radhika Sivaraj

    MDB JCA Transaction Issue

    Radhika Sivaraj Newbie

      I have an issue with JCA connection/ transaction while sending a reply message from MDB.

      Versions: JBoss 5.1.0, Hornetq 2.0.0.GA, EJB 3.0

      I have two queues (node1 and node2) in cluster and my MDB in node3 listening only to node1.

      My requirement is, any message when sent to node1 should be picked by MDB and the reply message from MDB should be sent by default to node1 but in case if it is down or if there is any temporary network failure the response should be sent to node2.
      So what I've done is in my MDB I've two JCA connections for sending the response message, one for node1 and one for node2. MDB by default uses node1 connection to send the response and if it cannot (after 1 attempt) in the catch block it tries to use the node2 connection to send the response message.

      The issue what I see is, while MDB is processing if the node1 connection breaks (say by pulling the network cable) before MDB could send the response message then I get a JMSException after one attempt (since I’ve set 1 as reconnect-attempts in ra.xml). Then within the catch block I’m trying to use the node2 connection to send the response message but I get the below exception.

      I hope I'm on the right track. If not pls suggest me how to achieve this.

      Steps to replicate the issue
      1. Send a message to request queue of node1. MDB picks it.
      2. While MDB is processing the message and before sending the response message, unplug the network cable of node1.
      Attempts to connect once to node1 and then in catch block it tries to connect to node2 but while getting a session it fails with the below exception.


      14:03:04,783 ERROR [STDERR] javax.transaction.SystemException: TransactionImple.enlistResource - XAResource.start [com.arjuna.ats.internal.jta.transaction.arjunacore.couldnotregister] [com.arjuna.ats.internal.jta.transaction.arjunacore.couldnotregister] could not register transaction: < 131075, 27, 25, 49454553511011004849515658551004958529897491015052101585110045535110110048495156585510049585298974910150521015855101 >
      14:03:04,783 ERROR [STDERR]  at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:870)
      14:03:04,783 ERROR [STDERR]  .