-
Bug
-
Resolution: Done
-
Critical
-
jBPM 3.1.0
-
None
createObject method of ObjectFactoryImpl class is not thread safe
Code:
public Object createObject(ObjectInfo objectInfo)
{ clearRegistry(); return getObject(objectInfo); }This can cause errors like
java.lang.RuntimeException: closed JbpmContext more then once... check your try-finally's around JbpmContexts blocks
at org.jbpm.JbpmContext.popThisContextFromTheStack(JbpmContext.java:493)
at org.jbpm.JbpmContext.close(JbpmContext.java:139)
due to bad context creation when calling JbpmConfiguration.createJbpmContext from a lot of different threads
It's difficult to produce, so try adding a sleep call after clearRegistry() in createObject method, and you will see the problem ...
I think adding a synchronized will correct the bug.
Code:
public synchronized Object createObject(ObjectInfo objectInfo) { clearRegistry(); return getObject(objectInfo); }
Regards,
Emmanuel