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

High number of queries (select ... from ContextMappingInfo...) when a signal with default scope is thrown in the multi instance sub-process and a parent process is using PerProcessInstance runtime strategy

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Major Major
    • None
    • 7.13.1.GA, 7.13.2.GA, 7.13.3.GA
    • jBPM Core
    • None
    • False
    • None
    • False
    • Hide

      As a workaround - use scope "per process".
       

      Show
      As a workaround - use scope "per process".  
    • ---
    • ---

      • RHPAM 7.13.1

       
      A signal with default scope and project scope work as expected in a parent process. However, for multi instance sub-process it performs search for all active processes and then for every process instance id performs select from the ContextMappingInfo table. At the end, the signal is only captured in the current process (so acts like "per process instance") but the number of ContextMappingInfo queries will be very large for a large number of active processes.

       

      See the attached signal-scope.zip project that shows the issue.  

       

      The log file will show something like this:

      **********************************************

      2023-06-08 14:03:16,875 TRACE [org.hibernate.engine.query.spi.HQLQueryPlan] (default task-17) Find: select processInstanceInfo.processInstanceId from ProcessInstanceInfo processInstanceInfo join processInstanceInfo.eventTypes eventTypes where eventTypes = :type
      2023-06-08 14:03:16,875 TRACE [org.hibernate.engine.spi.QueryParameters] (default task-17) Named parameters: {type=disable_update_document}
      2023-06-08 14:03:16,875 DEBUG [org.hibernate.SQL] (default task-17) select processins0_.InstanceId as col_0_0_ from ProcessInstanceInfo processins0_ inner join EventTypes eventtypes1_ on processins0_.InstanceId=eventtypes1_.InstanceId where eventtypes1_.element=?

      ...
      2023-06-08 14:03:16,876 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] (default task-17) extracted value ([col_0_0_] : [BIGINT]) - [46]
      ...
      2023-06-08 14:03:16,876 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] (default task-17) extracted value ([col_0_0_] : [BIGINT]) - [47]
      ...
      2023-06-08 14:03:16,876 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] (default task-17) extracted value ([col_0_0_] : [BIGINT]) - [49] 

      ...
      2023-06-08 14:03:16,876 TRACE [org.hibernate.type.descriptor.sql.BasicExtractor] (default task-17) extracted value ([col_0_0_] : [BIGINT]) - [50]

      **********************************************

      After this for every processInstanceId that is returned in the previous select, the following will be executed:

      **********************************************

      2023-06-08 14:03:16,877 TRACE [org.hibernate.engine.spi.QueryParameters] (default task-17) Named parameters: {contextId=46, ownerId=boundarySignalProject_1.0.0-SNAPSHOT}
      2023-06-08 14:03:16,877 DEBUG [org.hibernate.SQL] (default task-17) select contextmap0_.mappingId as mappingI1_8_, contextmap0_.CONTEXT_ID as CONTEXT_2_8_, contextmap0_.KSESSION_ID as KSESSION3_8_, contextmap0_.OWNER_ID as OWNER_ID4_8_, contextmap0_.OPTLOCK as OPTLOCK5_8_ from ContextMappingInfo contextmap0_ where contextmap0_.CONTEXT_ID=? and contextmap0_.OWNER_ID=?
      2023-06-08 14:03:16,877 TRACE [org.hibernate.resource.jdbc.internal.ResourceRegistryStandardImpl] (default task-17) Registering statement [org.jboss.jca.adapters.jdbc.jdk8.WrappedPreparedStatementJDK8@213a93de]
      2023-06-08 14:03:16,877 TRACE [org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl] (default task-17) Registering last query statement [org.jboss.jca.adapters.jdbc.jdk8.WrappedPreparedStatementJDK8@213a93de]
      2023-06-08 14:03:16,877 TRACE [org.hibernate.type.descriptor.sql.BasicBinder] (default task-17) binding parameter [1] as [VARCHAR] - [46]
      2023-06-08 14:03:16,877 TRACE [org.hibernate.type.descriptor.sql.BasicBinder] (default task-17) binding parameter [2] as [VARCHAR] - [boundarySignalProject_1.0.0-SNAPSHOT]
      2023-06-08 14:03:16,877 TRACE [org.hibernate.loader.Loader] (default task-17) Bound [3] parameters total
      2023-06-08 14:03:16,878 TRACE [org.hibernate.resource.jdbc.internal.ResourceRegistryStandardImpl] (default task-17) Registering result set [org.postgresql.jdbc4.Jdbc4ResultSet@1af3cd8]

      **********************************************

            ftirados Francisco Javier Tirado Sarti
            rhn-support-bkramer1 Biljana Kramer
            Marian Macik Marian Macik
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: