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

CorrelationKeyInfo table is used even without using correlation key functionality

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.8.0.GA
    • 7.6.0.GA
    • jBPM Core
    • CR1
    • +
    • Hide

      Start a process instance without a correlation key.

      Show
      Start a process instance without a correlation key.

      Even when not using the correlation key functionality, an entry is added to this table upon process instance creation, which results in one SELECT and one INSERT operation for each new process instance:

      2020-03-02 13:25:43,809 DEBUG [org.hibernate.SQL] (default task-3)
      insert into ProcessInstanceInfo (lastModificationDate, lastReadDate,
      processId, processInstanceByteArray, startDate, state, OPTLOCK) values
      (?, ?, ?, ?, ?, ?, ?)
      ...
      2020-03-02 13:25:43,816 DEBUG [org.hibernate.SQL] (default task-3)
      select correlatio0_.processInstanceId as col_0_0_ from
      CorrelationKeyInfo correlatio0_ where correlatio0_.name=?
      2020-03-02 13:25:43,817 TRACE
      [org.hibernate.type.descriptor.sql.BasicBinder] (default task-3) binding
      parameter [1] as [VARCHAR] - [19]
      2020-03-02 13:25:43,818 DEBUG [org.hibernate.SQL] (default task-3)
      insert into CorrelationKeyInfo (name, processInstanceId, OPTLOCK) values
      (?, ?, ?)
      2020-03-02 13:25:43,819 TRACE
      [org.hibernate.type.descriptor.sql.BasicBinder] (default task-3) binding
      parameter [1] as [VARCHAR] - [null]
      2020-03-02 13:25:43,819 TRACE
      [org.hibernate.type.descriptor.sql.BasicBinder] (default task-3) binding
      parameter [2] as [BIGINT] - [19]
      2020-03-02 13:25:43,819 TRACE
      [org.hibernate.type.descriptor.sql.BasicBinder] (default task-3) binding
      parameter [3] as [INTEGER] - [0]
      2020-03-02 13:25:43,820 DEBUG [org.hibernate.SQL] (default task-3)
      insert into CorrelationPropertyInfo (correlationKey_keyId, name, value,
      OPTLOCK) values (?, ?, ?, ?)
      2020-03-02 13:25:43,820 TRACE
      [org.hibernate.type.descriptor.sql.BasicBinder] (default task-3) binding
      parameter [1] as [BIGINT] - [19]
      2020-03-02 13:25:43,820 TRACE
      [org.hibernate.type.descriptor.sql.BasicBinder] (default task-3) binding
      parameter [2] as [VARCHAR] - [null]
      2020-03-02 13:25:43,820 TRACE
      [org.hibernate.type.descriptor.sql.BasicBinder] (default task-3) binding
      parameter [3] as [VARCHAR] - [19]
      2020-03-02 13:25:43,820 TRACE
      [org.hibernate.type.descriptor.sql.BasicBinder] (default task-3) binding
      parameter [4] as [INTEGER] - [0]
      

      This is done here:
      https://github.com/kiegroup/jbpm/blob/master/jbpm-persistence/jbpm-persistence-jpa/src/main/java/org/jbpm/persistence/processinstance/JPAProcessInstanceManager.java#L88-L96

      As a result of JBPM-4646 (case mgmt functionality):
      https://github.com/kiegroup/jbpm/commit/2f7a653bf0e9aacea8d817d6bee8631ed880538f
      https://issues.redhat.com/browse/JBPM-4646

      When using RHPAM at a larger scale with a high number of active process instances (several hundred thousands), the select from CorrelationKeyInfo queries result in a significant load on the DB server. This should be avoided in case no correlation key is used.

            elguardian@gmail.com Enrique González Martínez (Inactive)
            rhn-support-mputz Martin Weiler (Inactive)
            Gonzalo Muñoz Fernández Gonzalo Muñoz Fernández
            Gonzalo Muñoz Fernández Gonzalo Muñoz Fernández
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: