Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-4594

afterCompletion for DisposeSessionTransactionSynchronization is executed on a different thread

    Details

    • Steps to Reproduce:
      Hide

      Happens randomly. I don't know how to force afterCompletion to execute on a separate thread. Normally it executes on the same thread but once in a blue moon this happens.

      Show
      Happens randomly. I don't know how to force afterCompletion to execute on a separate thread. Normally it executes on the same thread but once in a blue moon this happens.

      Description

      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swiderski.maciej Maciej Swiderski
                Reporter:
                smcnutt Steven McNutt
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: