-
Bug
-
Resolution: Done
-
Major
-
jBPM 6.0.1.Final
-
None
The jta spec says afterCompletion can run in a separate thread.
The PerProcessRuntimeManager maintains a threadlocal of all the cached runtimeengines. When the transaction completes, afterCompletion could execute on a separate thread. disposeRuntimeEngine is called on the runtime manager, which then separately disposes the runtime engine, and removes it from the threadlocal.
It will dispose it, but not remove it from the threadlocal (because it's not actually in that specific threadlocal), meaning that future calls on the original thread might return the disposed object, leading to the exception: "Illegal method call. This session was previously disposed."
I have only been able to test on 6.0.1, but it looks like the problem still exists in 6.2.