Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2911

Possible performance problem caused by autoSaveProcessInstances

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • jBPM 3.2.10
    • jBPM 3.2.5.SP5
    • Runtime Engine
    • None
    • Low
    • Workaround Exists
    • Hide

      Avoid the xxxForUpdate methods. Call their normal counterparts.

      Show
      Avoid the xxxForUpdate methods. Call their normal counterparts.

    Description

      autoSaveProcessInstances is a List type field of JbpmContext class, which contains the processInstance needed to persistent to database.

      List autoSaveProcessInstances = null;

      Due to the List type of autoSaveProcessInstances, the same processInstance can be repeatedly added to autoSaveProcessInstances by JbpmContext.addAutoSaveProcessInstance method.

      public void addAutoSaveProcessInstance(ProcessInstance processInstance)

      { if (autoSaveProcessInstances == null) autoSaveProcessInstances = new ArrayList(); autoSaveProcessInstances.add(processInstance); }

      When invoked by JbpmContext.close method, JbpmContext.autoSave will iterate each processInstance in the autoSaveProcessInstances to save, thus the processInstance be saved repeatedly.

      void autoSave()
      {
      if (autoSaveProcessInstances != null)
      {
      Iterator iter = autoSaveProcessInstances.iterator();
      while (iter.hasNext())

      { ProcessInstance processInstance = (ProcessInstance)iter.next(); save(processInstance); iter.remove(); }

      }
      }

      In a web app based on seam 2.2.0, jbpm 3.2.5.sp5, a jsf request will cause the same processInstance to be saved more than 2000 times. The suggestion is to change the type of autoSaveProcessInstances from List to Set.

      Attachments

        Activity

          People

            aguizar_jira Alejandro Guizar (Inactive)
            aguizar_jira Alejandro Guizar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: