Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0-Alpha3
    • Fix Version/s: None
    • Component/s: JavaScript Client
    • Labels:
      None
    • Environment:
      ICEpush, ICEfaces

      Description

      If a user has multiple browser windows open in the same Ajax Push application (such as ICEfaces auction demo) it is possible that the Ajax Push notifications will cause the browser to issue concurrent requests to the server. This is not normally possible for a user, so many server-side frameworks are not thread-safe in these conditions (most frameworks are thread-safe against concurrent requests for different users).

      In particular, JSF is not thread-safe under concurrent requests from the same user.

      To guard against this, ICEfaces notifications can be queued.

        Activity

        Hide
        Ted Goddard added a comment -

        The following code attempts to analyze the threading behavior of the storage listener callback. On Safari and Firefox, the event listeners appear to be invoked in series, while on Chrome, they appear to be invoked in parallel. In all cases, the storage "set" call returns before the event listeners are invoked.

        <html>
        <body>
        <div id="localdiv">
        </div>
        <div id="outputdiv">
        </div>
        <input type="button" value="ping"
        onclick="localStorage.setItem('org.icefaces.notify',
        (new Date().getTime())); document.getElementById('localdiv').innerHTML =
        (new Date().getTime());" >
        <div id="busydiv">
        </div>
        <script>
        window.addEventListener('storage', storageListener, false);
        function storageListener(evt) {
        if (evt.key == "org.icefaces.notify") {
        var j=0,i=0;
        for (i=0;i<=50000;i++)

        { j++; document.getElementById("busydiv").innerHTML = j; }

        document.getElementById("outputdiv").innerHTML = evt.newValue + " " + ((new Date()).getTime() - evt.newValue);
        }
        }
        </script>
        </body>
        </html>

        Show
        Ted Goddard added a comment - The following code attempts to analyze the threading behavior of the storage listener callback. On Safari and Firefox, the event listeners appear to be invoked in series, while on Chrome, they appear to be invoked in parallel. In all cases, the storage "set" call returns before the event listeners are invoked. <html> <body> <div id="localdiv"> </div> <div id="outputdiv"> </div> <input type="button" value="ping" onclick="localStorage.setItem('org.icefaces.notify', (new Date().getTime())); document.getElementById('localdiv').innerHTML = (new Date().getTime());" > <div id="busydiv"> </div> <script> window.addEventListener('storage', storageListener, false); function storageListener(evt) { if (evt.key == "org.icefaces.notify") { var j=0,i=0; for (i=0;i<=50000;i++) { j++; document.getElementById("busydiv").innerHTML = j; } document.getElementById("outputdiv").innerHTML = evt.newValue + " " + ((new Date()).getTime() - evt.newValue); } } </script> </body> </html>
        Hide
        Ted Goddard added a comment -

        The important idea is multi-window notification using persistent storage.

        Show
        Ted Goddard added a comment - The important idea is multi-window notification using persistent storage.
        Hide
        Ted Goddard added a comment -

        On the BlackBerry console, the following is seen repeatedly, likely due to ICEpush cookie polling. This is causing power consumption on the device without need as it can only display a single window at a time.

        [0.0] start JSCmdGetCookieString
        [0.0] end JSCmdGetCookieString

        Show
        Ted Goddard added a comment - On the BlackBerry console, the following is seen repeatedly, likely due to ICEpush cookie polling. This is causing power consumption on the device without need as it can only display a single window at a time. [0.0] start JSCmdGetCookieString [0.0] end JSCmdGetCookieString
        Hide
        Mircea Toma added a comment -

        The inter-window notification mechanism using HTML5 local storage was carried as work under PUSH-136 issue.

        Show
        Mircea Toma added a comment - The inter-window notification mechanism using HTML5 local storage was carried as work under PUSH-136 issue.
        Hide
        Ted Goddard added a comment -

        This JIRA was mistakenly edited instead of the newly created PUSH-268 JIRA.

        Show
        Ted Goddard added a comment - This JIRA was mistakenly edited instead of the newly created PUSH-268 JIRA.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: