Details
-
Bug
-
Resolution: Done
-
Major
-
jBPM 3.2.5.SP5
-
None
-
Low
-
Workaround Exists
-
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())
}
}
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.