Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-705

BEFORE_COMPLETION Transactional observer is notified for transaction which is marked for rollback

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • 2.1
    • 2.0 .Final
    • Events
    • None

      In 10.4.5. Transactional observer methods CDI spec states:

      If the transaction is in progress, but javax.transaction.Synchronization callback cannot be
      registered due to the transaction being already marked for rollback or in state where
      javax.transaction.Synchronization callbacks cannot be registered, the before completion, after completion and after failure observer methods are notified at the same time as other observers, but after_success observer methods get skipped.

      This doesn't conform to JTA spec, which says in 3.3.2 Transaction Synchronization:

      The Synchronization.beforeCompletion method is called prior to the
      start of the two-phase transaction commit process. This call is executed with
      the transaction context of the transaction that is being committed.

      So the before_completion transactional observer shouldn't be notified for transaction marked for rollback.
      The method Synchronization.beforeCompletion is actually not called at WildFly and GlassFish app servers for transaction which is marked for rollback.

              Unassigned Unassigned
              tremes1@redhat.com Tomas Remes
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: