Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-3286

User task can cause race condition when multiple threads/process are storing the same org entity for the first time.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • False
    • False
    • Undefined
    • ---
    • ---

      When trying to perform bulk task operation(start/complete) then it fails with below exception:

      2020-07-28 15:01:35,221 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-1282) SQL Error: -803, SQLState: 23505 2020-07-28 15:01:35,221 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-1282) DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;$SCHEMA_NAME.ORGANIZATIONALENTITY, DRIVER=4.19.66 2020-07-28 15:01:35,222 WARN [org.jbpm.services.task.persistence.TaskTransactionInterceptor] (default task-1282) Could not commit session: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: 
      could not execute statement
      
      

      This issue occurs when task operation is performed by new users in parallel by multiple threads. This issue can be avoided by these two options:

      Update the database with this new user entry before the bulk task operation
      Complete a single task operation request first and then send the rest of the requests in parallel.

      [NOTE ENG](Not related to sync tables)

      I give some thought how to fix the issure related to Duplicated entity (race condition problem regarding saving org entities in the database.

      There is a way to serialize this with JMS would be to add a special queue to save this org entities outside the current transaction and before starting the task (we can a hidden action node prior the human task in charge of this, causing an async execution of the human task.

      [Start]> [Task] > [End]

      Would be transformed to:

      [Start]> [user save action node; hidden node] > [task; async=true] > [end]

      1) The user save action would send the org entities to a queue with a correlation key

      2) the MDB would retrieve that info a save it to the databasse

      3) it will be send back with a correlation key

      4) continue workflow.

            elguardian@gmail.com Enrique González Martínez (Inactive)
            elguardian@gmail.com Enrique González Martínez (Inactive)
            Antonio Fernandez Alhambra Antonio Fernandez Alhambra (Inactive)
            Antonio Fernandez Alhambra Antonio Fernandez Alhambra (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: