Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-1711

@CompensationScoped fails in CompensationHandler et al

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 5.0.0.M4
    • None
    • Compensations
    • None

    Description

      Beans annotated with @CompensationScoped are injected correctly in the application. However, the scope fails to be created for CompensationHandler, ConfirmationHandler and TransactionLoggedHandler implementations. This is because they are invoked by XTS, not the application and thus Weld is not active on the thread.

      The solution is to create the instance of the handlers using the BeanManager (this ensures Weld is active) and then set the ThreadContextClassLoader to the same as the one used by the application. This ensures that the application's Weld context is used when the handler is invoked.

      Attachments

        Activity

          People

            paul.robinson@redhat.com Paul Robinson
            paul.robinson@redhat.com Paul Robinson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2 days
                2d
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day Time Not Required
                1d