Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFTRY doesn't catch CFQUERY Timeout error

Guest
Nov 24, 2009 Nov 24, 2009

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

3.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Nov 24, 2009 Nov 24, 2009

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.

Translate
Valorous Hero ,
Nov 24, 2009 Nov 24, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 24, 2009 Nov 24, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 24, 2009 Nov 24, 2009

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}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 24, 2009 Nov 24, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 24, 2009 Nov 24, 2009
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources