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

afterCompletion for DisposeSessionTransactionSynchronization is executed on a different thread

    XMLWordPrintable

Details

    • 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.

      Attachments

        Activity

          People

            swiderski.maciej Maciej Swiderski (Inactive)
            smcnutt_jira Steven McNutt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: