0 Replies Latest reply on Mar 28, 2014 5:51 AM by Marco Baroetto

    JBPM 4.4: Avoid job retry on optimistic lock failure after join

    Marco Baroetto Newbie

      Hello, in the following process foo.MyClass is quite slow. The parallel branch reach the Join1 before Custom1 (MyClass) complete. After the join node the Custom1 task complete his job without errors, but I gets an optimistic lock failure when jbpm try to update the Execution:

      - org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#20102428]

      The RetryInterceptor catch the exception and relaunch Custom1 with a subsequent re-execuotion of MyClass code. How can avoid this behavior?

      Thank you



      <?xml version="1.0" encoding="UTF-8" standalone="no"?>

      <process xmlns="http://jbpm.org/4.4/jpdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="afterTimerJoin" xsi:schemaLocation="http://jbpm.org/4.4/jpdl jpdl-4.4.xsd">

        <start g="137,247,34,34" name="Start1">

          <transition g="0,0" name="to Fork1" to="Fork1"/>


        <fork g="271,260,34,34" name="Fork1">

          <transition g="0,0" name="to State1" to="State1"/>

          <transition g="0,0" name="to Fork2" to="Fork2"/>


        <state g="361,85,101,50" name="State1">

          <transition g="0,0" name="to State2" to="afterTimer">

            <timer duedate="3 minutes"/>



        <task g="556,281,101,50" name="Task1" swimlane="TEST">

          <transition g="0,0" name="to Join1" to="Join1"/>


        <swimlane assignee="TEST" name="TEST"/>

        <fork g="437,266,34,34" name="Fork2">

          <transition g="0,0" name="to Task1" to="Task1"/>

          <transition g="0,0" name="to Custom1" to="Custom1"/>


        <custom class="foo.MyClass" continue="async" g="465,178,101,50" name="Custom1">

          <transition g="0,0" name="to End1" to="End1"/>


        <end ends="execution" g="625,191,34,34" name="End1"/>

        <join g="886,185,34,34" multiplicity="1" name="Join1" >

          <transition g="0,0" name="to Task2" to="Task2"/>


        <task g="1007,210,101,50" name="Task2" swimlane="TEST">

          <transition g="0,0" name="to End2" to="End2"/>


        <end g="1152,245,34,34" name="End2"/>

        <task g="669,90,101,50" name="afterTimer" swimlane="TEST">

          <transition g="0,0" name="to Join1" to="Join1"/>