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

Observer methods process events in reverse order

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Minor
    • None
    • None
    • None
    • None
    • Hide

      see description

      Show
      see description

    Description

      It is possible and maybe intended that cdi events are executed in backward order on after transaction success observers?

      Let me explain what I do.

      I have 2 events that are fired on create and lock operations on objects.

      1. I lock an exiting objects and fire lock event for that object
      2. I create a new object that replaces the old one locked in first step and fire the create event for that new object
      3. I have different observer methods that reacts on both events. 2 Observer methos (one for lock and one for create) that reacts before transaction complettion (onBeforeCreate and onBeforeLock) and I have 2 observer methods for these events that are executed after transaction success (onAfterCreate and onAfterLock)
      3.1 At First the observer method onBeforeLock is called and then onBeforeCreate. This is ok, because that was the order I fired the events
      3.2 The the after transaction success observers are executed. But now first the onAfterCreate is called before onAfterLock. That is in reverse order that the events are fired

      Cause of this behaviour the logic in the observers are processed in wrong order and this runs in error.

      So is there a possibility to change the order of executing the observers in after sucess. Or maybe is this a bug?

      I use wildfly 10 with updated weld to Version 2.4.7.

      Regards
      Marco

      Attachments

        Activity

          People

            Unassigned Unassigned
            fambad Marco Strauch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: