8 Replies Latest reply on Sep 1, 2008 6:56 AM by Ilya Shaikovsky

    Mixing events on an eventsQueue

    Paul Pantages Novice

      Hello Forum,

      I understand how an eventsQueue and requestDelay can be used to remove duplicate requests.

      I wanted to know how this mechanism would behave if the same eventsQueue was shared by different components.

      An example of this would be an a4j:poll and several a4j:commandLinks using the same eventsQueue name.

      So, in this example, would a4j drop a "commmanLink" event when it is queued behind a "poll event' or does it recognize the two requests as different (and therefore not subject to de-duplication?).

      Also, if it does recognize that the events are different, will it still wait for the poll event to complete before invoking the "commandLinks" in the queue behind it? That is, would the queue prevent parallel/simultaneous submission of requests?

      I want to use the queue to serialize my commandLinks with the poller, to prevent race conditions and reslting exceptions I see when a poll is executed at the "same time" the operator invokes one of my other controls.

      PdP

        • 1. Re: Mixing events on an eventsQueue
          Sergey Smirnov Master

          similar events are the ones that produced by the same event. a4j:poll cannot produce the event that similar with a4j:commandLink. So, both event will be in the queue. The second will wait until the response from the first one comes back from the server.

          • 2. Re: Mixing events on an eventsQueue
            Paul Pantages Novice

            Thank you Sergey, for your quick reply.

            This is exactly what I hoped it would do... PdP

            • 3. Re: Mixing events on an eventsQueue
              Paul Pantages Novice

              Hello Forum,

              I am using:
              Jboss 4.2.2.GA
              Seam 2.0.1.GA
              Richfaces 3.2.1.GA

              I have another problem with my poller and command links. It appears that, if I have a poll that is fairly lengthy, (due to a large row count on my rich:dataTable ), if I submit a commanLink event "during" a long poll event, the commandLInk completes its update before the poll.

              That is the results of the poll (first req) overwrites the results of the command link (second req).

              The poll and commandLinks share the same eventsQueue.

              I verified this by using onbeforedomupdate="alert()" in my poll and links.
              I have a statusRegion on my page so I can tell when a poll has started, and can submit my commandLInk "during" the poll operation. The onbeforedomupdate for the commandLink is fired before the one for the poll.

              I conclude that, even if the queue forces the requests to be processed in fifo order, the responses are not necessarily similarly handled?

              Is there an easy way I can force the dom updates to occur in the same order as the original requests?

              here is my poll:

               <a4j:region renderRegionOnly="false">
               <a4j:poll
               id="subnetTreePoller"
               action="#{login.checkLoggedin}"
               interval="#{activeAlarmsImpl.ajaxPollInterval}"
               enabled="true"
               onsubmit="if(getPollEnabled()==false){return false}"
               onbeforedomupdate="alert('POLL before dom')"
               status="pollingStatus"
               eventsQueue="ajaxQueue"
               oncomplete="resizeScrollBox();"
               reRender="#{activeAlarmsImpl.ajaxRenderList}">
               </a4j:poll>
               </a4j:region>
              


              link:

               <a4j:commandLink
               title="Unselect all #{object}s"
               reRender="#{reRender}"
               eventsQueue="ajaxQueue"
               onbeforedomupdate="alert('unselectall before dom')"
               oncomplete="unselectAll('#{tableId}')"
              
               ajaxSingle="true"
               action="#{entity.unselectAll}" >
              
               <ui:include src="/view/utils/toolicon.xhtml">
               <ui:param name="src" value="#{unselectAllImg}"/>
               <ui:param name="alt" value="UnselectAll"/>
               </ui:include>
              
               </a4j:commandLink>
              


              • 4. Re: Mixing events on an eventsQueue
                Ilya Shaikovsky Master

                try to add ignoreDupResponces=true also.

                • 5. Re: Mixing events on an eventsQueue
                  Paul Pantages Novice

                  Hello Ilya, thank you for the suggestion.

                  I have tried ignoreDupResponses, but this did not change the behaviour or fix my problem. I double checked this to be sure.

                  This, I think, makes sense according to the documentation and Sergey's comments earlier in this thread.

                  PdP

                  • 6. Re: Mixing events on an eventsQueue
                    Ilya Shaikovsky Master

                    Ok.. Could you add jira ticket please with simple war and step by step description. Then it'll be investigated asap.

                    • 7. Re: Mixing events on an eventsQueue
                      Paul Pantages Novice

                      JIRA AJSF-142

                      Thanks, PdP

                      • 8. Re: Mixing events on an eventsQueue
                        Ilya Shaikovsky Master

                        Moved to https://jira.jboss.org/jira/browse/RF-4352..

                        All the bugs should be in RF jira after projects merge.