PDA

View Full Version : form-option "timeout" has no effect



robpi
21 Jun 2007, 7:41 AM
I'm using a form to pass parameters to start a sql query. The result is presented in a grid.
It works fine until the query is not longer than 30 sec. When the querytime is longer, then the result doesn't come back because of a time out.
In the API i found the form option "timeout", but it seems this has no effect. the problem keeps the same. Has anyone used the timeout-option with success?

Here some Code snippets:

constraintsform = new Ext.form.Form({timeout:999999});
...
constraintsform.addButton({text:'Start', tooltip:'Starten der Abfrage', handler:dwhStatistikcenter_Constraints.startQuery });
constraintsform.render('constraints');
...
...
startQuery : function () { constraintsform.submit({loadMask:true,url:url,params:{task:'startquery'},success:Resultgrid.updateGrid,failure:Constraints.showQueryError});
};


In the request header i find the information:
Keep-Alive 300
Connection keep-alive

So it seems that the option has no effect. Or do i use it in the wrong way?

neongrau
21 Jun 2007, 11:39 PM
i'm experiencing the same problem.
some administrative tasks on the server side always times out after 30 secs despite the fact that i set timeout to 500 secs.

could this be a bug?

robpi
22 Jun 2007, 5:18 AM
At this moment i think it's a bug. But am a ext-beginner and in a learning-phase. I'will keep on trying to get a solution to the timeout - problem. I will share my realizations again in this thread. Meanwhile, maybe more ext-users could report, how they make requests over 30sec possible.

liggett78
22 Jun 2007, 5:20 AM
"Keep alive" has nothing to do with timeout you mean, it simply instructs the browser or the server to keep the connection alive for the specified amount of time. It reduces the overhead of having to open a new tcp connection (with handshake etc.) for each image, js or css file of your page for example.

The thing is, I've had similar problems, albeit with Ext.data.Connection, which does not respect timeout due to this code in Connection.request()

var cb = {
success: this.handleResponse,
failure: this.handleFailure,
scope: this,
argument: {options: o},
timeout : this.timeout <-- should take the value from options.timeout if present
};

My solution was to set timeout on the connection object instance. Form submit uses a different function call though, so you have to step through the code and verify that your value is passed to Ext.lib.Ajax.formRequest.

robpi
23 Jun 2007, 12:46 PM
I also found a solution in changing the timeout:30000 value in ext-all-debug.js (Ext.extend(Ext.data.Connection, Ext.util.Observable...)).

Now it works as it should. But it would be nice if the timeout-option in the form would make this work.

gnosis
12 Jul 2007, 1:46 PM
I'm having a related but opposite problem with form requests. I want my requests to time out sooner than 30 seconds.

I've tried passing a config option of timeout:15 to the form object, but it has no effect. I also tried, for the heck of it, passing timeout:15 as a config option in the submit() function, but no dice. I'm stuck waiting 30 seconds for a failure no matter what.

Any ideas?

Thanks,
G

robpi
12 Jul 2007, 11:43 PM
try to set the timeout by doing the following:
Ext.Ajax.timeout=15000;

It's the solution, i'm using at this moment. Only with a bigger time-value.