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

Failing dabase batch operation can lead to inconsistent database state

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: L3 - Default
    • Resolution: Fixed
    • Affects Version/s: 7.10.0, 7.11.0, 7.12.0
    • Fix Version/s: 7.12.0, 7.9.14, 7.10.8, 7.11.2, 7.12.0-alpha2
    • Component/s: engine
    • Labels:
      None
    • Environment:
      JDK 8, Microsoft SQL Server 2014
    • Title Keywords:
      history cleanup, optimistic locking exception

      Description

      Given:

      • the skipHistoryOptimisticLockingExceptions configuration flag is set to (the default value) true in order to suppress OptimisticLockingExceptions for Historic Entities
      • JDBC batch processing is used

      When:

      • Two jobs are executed in concurrent transactions
      • Both jobs try to create the same process variable (runtime)
      • In one of the transactions this causes a constraint violation, which the engine treats as an optimistic locking case, because it indicates a problem with parallel modification
      • The engine tries to determine if it should throw OptimisticLockingException or not (taking skipHistoryOptimisticLockingExceptions into account)

      Then:

      • OptimisticLockingException is incorrectly not thrown.
      • The remainder of the JDBC batch is not retried
      • The rest of the database flush continues.
      • The transaction commits
      • The jobs are not removed from the database, leading to an inconsistency in database state

      Expected:

      • OptimisticLockingException is thrown and the transaction rolls back
      • This requires hasOptimisticLockingException method (determines the failed db operation) to return the correct failing operation in case of JDBC batching

      Hints (optional):

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              nikola.koevski Nikola Koevski
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development