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

define behaviour of firing an event for an observer with transaction if the transaction is not open or marked rollback

    XMLWordPrintable

    Details

    • Type: Clarification
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.2.Final
    • Fix Version/s: 2.0 .Final
    • Component/s: None
    • Labels:
      None

      Description

      The original problem description can be found at https://issues.apache.org/jira/browse/OWB-1111

      If you have an observer

      public void clearCacheAfterTx(@Observes(during=TransactionPhase.AFTER_COMPLETION) ClearAfterTx payload) {...}
      

      and you fire the event

      clearCacheEvent.fire(new ClearCacheEvent());
      

      In this case the behaviour when firing the event if the underlying transaction is already closed or rolled back is totally undefined. It might blow up or continue silently depending on the server.

      The problem is that you cannot enlisten a Synchronisation at the tx anymore.

      I think we should define/clarify how it should behave in the various phases.

      E.g. a during=AFTER_SUCCESS should NOT deliver the event immediately if the tx is already marked for rollback. But for AFTER_COMPLETION it might be perfectly fine.
      At the end we need a matrix of the the event phases + possible Exceptions

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              struberg Mark Struberg
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: