I'm tuning a web app based seam 2.2.0 and jBPM 3.2.5.sp5. The call tree of CPU view in the jProfiler shows that the jbpmContext.save(ProcessInstance processInstance) was called more than 2000 times in a jsf request.
After debugging the source code of app, seam, and jBPM, I found that each event-scoped component initialization in a jsf request would cause the same processInstance associated with the business process context to be added to the autoSaveProcessInstances by jbpmContext.autoSaveProcessInstances method. So in the end of a jsf request, each of the same processInstance in the autoSaveProcessInstances would be repeatedly saved in the jbpmContext.autoSave. How can i avoid to repeatedly save the same processInstance? Any suggestion are greatly appreciated.