Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-2124

DB Update error after incident is updated when non-term end event is reached

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: L3 - Default
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.2.0, 7.1.2, 7.2.0-alpha1
    • Component/s: engine
    • Labels:
      None

      Description

      Forum post discussing the issue:

      https://groups.google.com/forum/#!topic/camunda-bpm-dev/8HpZEaDxft0

      I have a scenario related to CAM-428. In this scenario, I allow a Service task in one of the execution paths to fail, exhaust it's retries and cause an incident to be created. On the other execution path there is a timer which delays until the incident is created - see attached process example. When the timer fires, the process continues on, triggering the end event, eventually resulting in an attempt to update the incident with the root execution Id. The result is an update error because the Incident mybatis configuration doesn't have an entry for updates - see stack trace below. The fix is to add the update entry in the mybatis configuration - see below. However, my question is was that left out on purpose? The incident has no version field which would be needed to properly handle concurrent updates. If it is ok with camunda I can perform a pull request with the addional configuration.

          1. Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for updateIncident
          2. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for updateIncident
            at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147)
            at org.camunda.bpm.engine.impl.db.DbSqlSession.flushUpdates(DbSqlSession.java:699)
            at org.camunda.bpm.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:500)
            at org.camunda.bpm.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:211)
            at org.camunda.bpm.engine.impl.interceptor.CommandContext.close(CommandContext.java:154)
            at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
            at org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:59)
            at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
            at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:79)
            at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:67)
            at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
            at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:806)
            at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
            at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:826)
            at java.lang.Thread.run(Thread.java:722)
            at org.jboss.threads.JBossThread.run(JBossThread.java:122)
            Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for updateIncident
            at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:672)
            at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:507)
            at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:500)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:144)
            ... 15 more

      Proposed addition to the mybatis configuration for incident.xml:

      <update id="updateIncident" parameterType="org.camunda.bpm.engine.impl.persistence.entity.IncidentEntity">
      update ${prefix}ACT_RU_INCIDENT set
      INCIDENT_TIMESTAMP_ = #

      {incidentTimestamp, jdbcType=TIMESTAMP}

      ,
      INCIDENT_MSG_ = #

      {incidentMessage, jdbcType=VARCHAR}

      ,
      INCIDENT_TYPE_ = #

      {incidentType, jdbcType=VARCHAR}

      ,
      EXECUTION_ID_ = #

      {executionId ,jdbcType=VARCHAR}

      ,
      ACTIVITY_ID_ = #

      {activityId ,jdbcType=VARCHAR}

      ,
      PROC_INST_ID_ = #

      {processInstanceId ,jdbcType=VARCHAR}

      ,
      PROC_DEF_ID_ = #

      {processDefinitionId ,jdbcType=VARCHAR}

      ,
      CAUSE_INCIDENT_ID_ = #

      {causeIncidentId ,jdbcType=VARCHAR}

      ,
      ROOT_CAUSE_INCIDENT_ID_ = #

      {rootCauseIncidentId ,jdbcType=VARCHAR}

      ,
      CONFIGURATION_ = #

      {configuration, jdbcType=VARCHAR}

      where ID_ = #

      {id, jdbcType=VARCHAR}

      </update>

        Attachments

          Activity

            People

            Assignee:
            sebastian.menski Sebastian Menski
            Reporter:
            clint.manning clint.manning
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: