2 Replies Latest reply on Jun 10, 2010 7:20 PM by rhodos

    Optimistic Locking at Join

    rhodos

      One more question regarding transactions:

       

      The following looks like a bug to me, from the User Guide:

       

      "Value exclusive was selected to serialize the executions of        the 2 asynchonous  continuation jobs resulting from the fork. The  respective transactions         that will execute activities ship goods and send  bill will both arrive at the  join.  At the join, both         transactions will synchronize on the same execution (read: update  the  same execution        row in the DB), resulting in a potential  optimistic locking  failure."

       

      I've seen this in action, where an exception is thrown when I try to execute a forked process.  The only workaround I've seen is to call Thread.sleep() in my driver class after I instantiate the process, where I must cause the thread to sleep until after the join is reached.  However, this obviously requires knowing ahead of time about how long this will take.

       

      Does anyone know a better way to deal with this? I was thinking there might be a way to use wait/notifyAll, either in the Fork and Join activities, or with the Join activity notifying the main thread in the driver class.

       

      Any advice would be greatly appreciated.

      Thanks,

      Rachel

        • 1. Re: Optimistic Locking at Join
          aguizar

          Does anyone know a better way to deal with this? I was thinking there might be a way to use wait/notifyAll, either in the Fork and Join activities, or with the Join activity notifying the main thread in the driver class.

          Yes. We have to "foreport" the join solution from jBPM 3.2.9 (see JBPM-2790) to jBPM 4.4. For the time being, try setting the continue attribute to async or exclusive in the join activity in order to reduce the window of opportunity for a locking conflict.

          • 2. Re: Optimistic Locking at Join
            rhodos

            Alejandro,

             

            Thanks for the answer, though I'm already doing this.  I'll just wait for 4.4- is there a new estimate as to when it will be out?

             

            Rachel