Activiti
  1. Activiti
  2. ACT-1170

'selectExclusiveJobsToExecute' does not work for DB2 and MSSQL

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.9
    • Fix Version/s: 5.10
    • Component/s: Engine
    • Labels:
      None
    • Number of attachments :
      1

      Description

      For DB2 and MSSQL, we had to change EXCLUSIVE_ = TRUE to EXCLUSIVE_ = 1 (it then becomes the similar statement as 'selectExclusiveJobsToExecute_oracle').

      Not working for DB2 and MSSQL:

      <select id="selectExclusiveJobsToExecute" parameterType="map" resultMap="jobResultMap">
          select * 
          from ACT_RU_JOB     
          where (RETRIES_ &gt; 0)
            and (DUEDATE_ is null or DUEDATE_ &lt; #{now, jdbcType=TIMESTAMP})
            and (LOCK_OWNER_ is null or LOCK_EXP_TIME_ &lt; #{now, jdbcType=TIMESTAMP})
            and (RETRIES_ &gt; 0)
            and (EXCLUSIVE_ = TRUE)
            and (PROCESS_INSTANCE_ID_ = #{pid})  
        </select>
      

      Working for DB2 and MSSQL:

      <select id="selectExclusiveJobsToExecute_custom" parameterType="map" resultMap="jobResultMap">
      	  select *
      	  from ACT_RU_JOB
      	  where (RETRIES_ &gt; 0)
      	  and (DUEDATE_ is null or DUEDATE_ &lt; #{now, jdbcType=TIMESTAMP})
      	  and (LOCK_OWNER_ is null or LOCK_EXP_TIME_ &lt; #{now, jdbcType=TIMESTAMP})
      	  and (RETRIES_ &gt; 0)
      	  and (EXCLUSIVE_ = 1)
      	  and (PROCESS_INSTANCE_ID_ = #{pid})
        </select>
      

        Issue Links

          Activity

          Hide
          Rene Gielen added a comment -

          Can confirm that it runs in our environment as well.
          Any news on a fix release like 5.9.1? This is definitely a blocker for MSSQL users.

          Show
          Rene Gielen added a comment - Can confirm that it runs in our environment as well. Any news on a fix release like 5.9.1? This is definitely a blocker for MSSQL users.
          Hide
          Michallis Pashidis added a comment - - edited

          Does somebody know how to fix this temporary?
          We use the activiti engine in a project, importing it in our pom.

          Should i check the activiti engine out, make the changes proposed in this issue and rebuild with an intermediate version?

          Any help should be great, i had discovered already the problem in ACT_RU_JOB EXCLUSIVE_ but don't know the impact of that.

          How should i use the patch? Should i just modify the job.xml?

          my sincere thanks,

          Michallis

          Show
          Michallis Pashidis added a comment - - edited Does somebody know how to fix this temporary? We use the activiti engine in a project, importing it in our pom. Should i check the activiti engine out, make the changes proposed in this issue and rebuild with an intermediate version? Any help should be great, i had discovered already the problem in ACT_RU_JOB EXCLUSIVE_ but don't know the impact of that. How should i use the patch? Should i just modify the job.xml? my sincere thanks, Michallis
          Hide
          Etienne Studer added a comment -

          Some of the comments above explain what Activiti methods to override to make this work without having to build a custom Activiti.

          Show
          Etienne Studer added a comment - Some of the comments above explain what Activiti methods to override to make this work without having to build a custom Activiti.
          Hide
          Daniel Meyer (camunda) added a comment -

          Fixed on trunk. Thanks Etienne for the patch.

          Show
          Daniel Meyer (camunda) added a comment - Fixed on trunk. Thanks Etienne for the patch.
          Hide
          Michallis Pashidis added a comment -

          Thank you Etienne and Daniel!

          Show
          Michallis Pashidis added a comment - Thank you Etienne and Daniel!

            People

            • Assignee:
              Daniel Meyer (camunda)
              Reporter:
              Etienne Studer
            • Votes:
              5 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: