Possible performance problem caused by autoSaveProcessInstances
---------------------------------------------------------------
Key: JBPM-2911
URL:
https://jira.jboss.org/browse/JBPM-2911
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 3.2.5.SP5
Reporter: Alejandro Guizar
Fix For: jBPM 3.2.10
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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira