Each client creates a JbpmContext executes several BPM and closes JbpmContext. The first implementation of BPM is slower than subsequent executions, since this creates the SessionFactory for Hibernate, the others are fast. If 2 or more clients simultaneously run every first execution of a bpm by a thread becomes very slow. Why ? It seems that the piece of code is slow when I call JbpmContext.newProcessInstace (bpm).
How can I fix? The Hibernate SessionFactory can be singleton?