1 Reply Latest reply on Oct 3, 2006 9:59 AM by Andrew Redhead

    Transacted JMS from an Action

    Andrew Redhead Newbie

      Hi,

      I have an action on a transition, in that action I post a message onto a JMS queue (using a jms session created with transact=true).

      jBPM is being called from an EJB3 stateless session bean with the default "REQUIRED" transaction setting.

      The behaviour I was hoping to see was that if the execution of jBPM failed (because of a problem in a later action), the whole transaction is rolled back - including not posting the jms message...

      It seems that when I look up the jms connection factory from the action and create the transacted session, I get a new XA session, which needs to be committed seperately from the surrounding ejb3 transaction.

      Any ideas how I can get the jms session and jbpm to "be in the same transaction"?

      One option I'm trying to avoid is putting an asynchronous execution onto the later actions. However, if the work on JMS based asyc execution is ok for production use then I guess this might be a way forward (on the basis that doing the transition can't really fail so failures in later steps shouldn't really be a problem for the current client...).

      Cheers,

      Andy