3 Replies Latest reply on Mar 9, 2015 2:27 AM by swiderski.maciej

    [JBPM5.4] Join JBPM transactions with current MDB context user transaction

    javaken

      Hi All!

       

      I'm currenlty doing an upgrade project from jPDL 3 to JBPM 5. I'm kinda stucked on how can I merge the JBPM 5's transaction manager to use my current MDB context's user transaction. I wanted to do all the JBPM 5 persistence commit when the MDB user transaction is also committed. I'm using BMT by the way. Is this even possible in JBPM 5.4?

       

      swiderski.maciej please help! Thank you so much in advance!

        • 1. Re: [JBPM5.4] Join JBPM transactions with current MDB context user transaction
          swiderski.maciej

          if you use BMT there is no need to do any special configuration in jBPM as it will use JTA (UserTransaction) to manage transaction. Just make sure that you start transaction before you invoke any jBPM operations.

           

          P.S.

          Please use jBPM user forum for jBPM related questions - much higher changes to get responses.

           

          HTH

          • 2. Re: [JBPM5.4] Join JBPM transactions with current MDB context user transaction
            javaken

            Thanks for the reply Maciej! Forgot to mention that I'm running the application in WebSphere 7 with Spring 3 and Hibernate 4. Basically I start my process from the first MDB and inside this bean I'll be sending new JMS messages to trigger the next MDB to continue the workflow. The issue here is that it seems the JBPM is running its own JBPM JTA transaction instead of using the current MDB context's user transaction. JMS messages were put into queue once the MDB's user transaction is committed. So maybe at some point in time, the next MDB is already getting the process instance but the lock is still in the previous MDB's JBPM user transaction that causes optimistic locking exceptions.

             

            Sorry I'm just new in the group. I really appreciate your help!

            • 3. Re: [JBPM5.4] Join JBPM transactions with current MDB context user transaction
              swiderski.maciej

              make sure your queue is transactional as it might be that second MDB starts to process the message before first MDB is committed and thus causing optimistic lock exceptions.

               

              HTH