5 Replies Latest reply on Jun 14, 2010 10:36 PM by rebody

    JBPM-2820 and JBPM-2702

    rebody

      Hi guys,

       

      Both of https://jira.jboss.org/browse/JBPM-2820 and https://jira.jboss.org/browse/JBPM-2702 maybe caused by a same reason.  I upload a patch to change the location of compositeIds().  And I think it may solve these two problems,  But, still,  I have neither DB2 or MSSql environment to test it.   But after use the patch, all of testcases still could pass.

       

      So,  could I just commit this patch and let other people test it?

       

      the patch is on the JBPM-2820:  https://jira.jboss.org/browse/JBPM-2820

       

      Any advices would be appreciated.

        • 1. Re: JBPM-2820 and JBPM-2702
          swiderski.maciej

          Hi HuiSheng,

           

          please take a look at createExecution method in ExecutionImpl to verify if your fix is appropriate:

           

              childExecution.save();
              // make sure that child execution are saved before added to a persistent collection
              // cause of the 'assigned' id strategy, adding the childExecution to the persistent collection 
              // before the dbid is assigned will result in identifier of an instance of ExecutionImpl altered from 0 to x
              addExecution(childExecution);
              // composeIds uses the parent so the childExecution has to be added before the ids are composed
              childExecution.composeIds();
          

          After your fix composeIds will be called twice, my concern is if that will not cause us any troubles. It is better to double check it.

           

          Cheers

          Maciej

          • 2. Re: JBPM-2820 and JBPM-2702
            rebody

            Hi Maciej,

             

            Thank you for reviewing.  I will go back and find a way to handle this.  Thank you.

            • 3. Re: JBPM-2820 and JBPM-2702
              rebody

              Hi Maciej,

               

              I attached a new patch to prevent executing composeIds() twice in createExecution().  All of testcase could pass.  If you have time, please have a look at it.

               

              The key is we have to generate dbid, parent id, then we could save the execution.  And the code for generating dbid is only exists in the save() method.  setParent() mehod is only exists in the addExecution() method.

               

              So this time, I execution setParent() by hand before save().  I think this could be solve this problem.

               

              https://jira.jboss.org/browse/JBPM-2820

               

              JBPM-2820-2010-06-12.patch
              • 4. Re: JBPM-2820 and JBPM-2702
                swiderski.maciej

                Looks good to me.

                • 5. Re: JBPM-2820 and JBPM-2702
                  rebody

                  Done, checked in r6414.