Hide
It seems that somehow the timeout that is set on my first dwr call doesn't get 'cleared' properly, and i end up getting a timeout on a subsequent call. Everything works correctly on IE7 though. The remote method that is called takes about one second to execute. With firefox I get an 'instant' timeout after around every 5th call (which coincides with the set timeout of 5s).
The following code should hopefully clarify the problem:
var requestInProgress = false; // flag so the calls don't overlap.
setInterval(pollResult, 1000); // Fire requests periodically (to
demonstrate the issue)
function pollResult() {
if (requestInProgress) return;
else requestInProgress = true;
Remote.someMethod("test", {
callback: function() { requestInProgress = false; },
timeout: 5000, // About every 5th call returns
instantly with a timeout
errorHandler: function() { alert("timeout"); requestInProgress =
false; }
});
}
The dwr.xml looks like this:
...
<create creator="spring" javascript="Remote">
<param name="beanName" value="remote" />
</create>
...
application-context.xml:
...
<bean id="remote" class="de.mb.test.dwr.Remote" />
...
I am currently using DWR Version 2.0.2 in combination with Spring 2.05 and Tomcat v5.5.
Show
It seems that somehow the timeout that is set on my first dwr call doesn't get 'cleared' properly, and i end up getting a timeout on a subsequent call. Everything works correctly on IE7 though. The remote method that is called takes about one second to execute. With firefox I get an 'instant' timeout after around every 5th call (which coincides with the set timeout of 5s).
The following code should hopefully clarify the problem:
var requestInProgress = false; // flag so the calls don't overlap.
setInterval(pollResult, 1000); // Fire requests periodically (to
demonstrate the issue)
function pollResult() {
if (requestInProgress) return;
else requestInProgress = true;
Remote.someMethod("test", {
callback: function() { requestInProgress = false; },
timeout: 5000, // About every 5th call returns
instantly with a timeout
errorHandler: function() { alert("timeout"); requestInProgress =
false; }
});
}
The dwr.xml looks like this:
...
<create creator="spring" javascript="Remote">
<param name="beanName" value="remote" />
</create>
...
application-context.xml:
...
<bean id="remote" class="de.mb.test.dwr.Remote" />
...
I am currently using DWR Version 2.0.2 in combination with Spring 2.05 and Tomcat v5.5.