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

@CompensationScoped fails in CompensationHandler et al

XMLWordPrintable

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

      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.

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

              Created:
              Updated:
              Resolved:

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