
Copy link to clipboard
Copied
I have a query that is taking too long to execute. After about two minutes I get an error, The request has exceeded the allowable time limit Tag: CFQUERY
First issue: I added timeout="300" to the cfquery tag and this didn't seem to have any effect. It is an Oracle database.
Second issue: I tried wrapping the <cfquery> in a cftry/cfcatch block. Basically like this:
<cftry>
<cfquery ...>
sql statement
</cfquery>
<cfcatch type="any">
<cfoutput>some stuff</cfoutput>
</cfcatch>
</cftry>
This does not seem to trap the error - it still runs about two minutes, then displays the same error - only this time is says Tag: cfoutput!
I tried adding a <cfthrow> before the query and then it does execute the <cfcatch>.
What's going on here? I've never run into anything like this before.
Ken
1 Correct answer
The error is being thrown by the Application Server because it is timing out the thread.
It then reports the last tag it new about before the thread took too long to respond.
For your changes to take affect you either need to add:
1) a <cfsetting requesttimeout="{seconds}"> tag to allow this page to run longer then the default value
AND|OR
2) adjust the defult Timeout Requests after ( seconds ) value for all templates in the CF Administrator.
Copy link to clipboard
Copied
The error is being thrown by the Application Server because it is timing out the thread.
It then reports the last tag it new about before the thread took too long to respond.
For your changes to take affect you either need to add:
1) a <cfsetting requesttimeout="{seconds}"> tag to allow this page to run longer then the default value
AND|OR
2) adjust the defult Timeout Requests after ( seconds ) value for all templates in the CF Administrator.
Copy link to clipboard
Copied
You can't try/catch this sort of thing because the requesttimeout is set at application server level or can be overriden at request level.
In CFAdmin there's a request timeout setting, and unless specified otherwise, the CF server will kill any request that takes longer than that timeout.
If you have a request that you know will take longer than the default timeout, you can extend its timeout with the <cfsetting> tag: http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_r-s_18.html#2916189
--
Adam
Copy link to clipboard
Copied
Adam! People are going to start accusing us of an unnatural relationship of some type or the other if we keep giving the same information at the same TIME!!!
{look at the time stamp of our responses}
Copy link to clipboard
Copied
Hehhehhehheh.
Yes... I saw we've had a couple of those today.
Well two people saying the same thing must eb more convincing than just one... so it's not like it's wasted effort.
--
Adam

Copy link to clipboard
Copied
Thanks to both of you. I knew about the cfsetting tag
but for some reason I had it in my head that the error was coming from the database and setting the requ
esttimeout wouldn't affect it.

