Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2095

Undefined behavior when firing an event for an observer with transaction if the transaction is not open or marked rollback

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 3.0.0.Alpha14, 2.3.2.Final
    • None
    • None

      Based on CDI-578.
      The spec does not define behavior when you fire an event for an observer with transaction when the transaction itself is not active anymore (or was rolled back).

      We should determine how to react to such events.

      There are two cases:

      • Bean Managed Transaction (BMT)
        • Dirty reproducer can be found here
        • In this scenario no exception was thrown
        • All observers were notified in the following order: IN_PROGRESS, AFTER_COMPLETION,AFTER_FAILURE, BEFORE_COMPLETION, AFTER_SUCCESS
        • method org.jboss.weld.event.TransactionalObserverNotifier.deferNotification(T, EventMetadata, ObserverMethod<? super T>) was not called at all
      • Container Managed Transaction (CMT)
        • Dirty reproducer available here
        • This throws WFLYTX0029: Syncs are not allowed to be registered when the tx is in state 1, where state 1 stand for STATUS_MARKED_ROLLBACK
        • The exception is thrown as soon as you attempt to fire the event, so obviously no observers are notified

            Unassigned Unassigned
            manovotn Matěj Novotný
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: