[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-3721) Seam Remoting Callback not set before server response comes back

Paul Chan (JIRA) jira-events at lists.jboss.org
Tue Nov 18 01:27:36 EST 2008

Seam Remoting Callback not set before server response comes back

                 Key: JBSEAM-3721
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3721
             Project: Seam
          Issue Type: Bug
          Components: Remoting
    Affects Versions: 2.1.0.SP1, 2.1.0.GA
         Environment: XP SP3, VMWARE 3.5i ESX, 2GB RAM, DualCore AMD 3800+
            Reporter: Paul Chan
            Assignee: Shane Bryzak

Original Issue
I tracked the issue down to one line of javascript code in remote.js

   req.onreadystatechange = function() {};

The following thread discusses the problem is with an old version of the JScript.dll which is the same version I've got on a laptop here.


One solution is to upgrade JScript.dll to


Or we can do what they did in GWT which is to move the req.onreadystatechange out of the scope of the current function

    window.setTimeout(function() {
     req.onreadystatechange = function() {};
     }, 0 );

Problem found with the above fix
I have found a bug in this fix.

If the server response comes back before the "window.setTimeout(xxx,0) expires, it will drop it.
>From reading the javascript specs, the minimum timeout value is actually around 25ms. Anything smaller than that, it gets rounded up.
Also, using timer to set response callback are inherently flawed IMO. There's always going to be some sort of race condition.

This problem seems to happen on internet explorer, and safari. Firebox doesn't seem to have a problem with it though.

I discovered this problem when I set a break point on the incoming request processing code on the server. If the breakpoint is inserted, everything is good. But when I removed the breakpoint, the problem appears again.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list