RE: CFQuery wrapper tag to help with poor connections to sql..
Interesting. I might trying using the timeout before resorting to the nested try/catches. -Original Message- From: Wil Genovese [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 12:46 PM To: CF-Talk Subject: Re: CFQuery wrapper tag to help with poor connections to sql.. Also remember the timeout attribute for cfquery. It accepts integers as seconds. cfquery name=users datasource=#myDSN# timeout=2 SELECT user_id FROM users /cfquery -- Wil Genovese One man with courage makes a majority. -Andrew Jackson A fine is a tax for doing wrong. A tax is a fine for doing well. Rich wrote: I have an app that has to use a connection that sees a few seconds of disconnectivity from its SQL server occasionaly. Dan, You can nest CFTRY's to accomplish this. Something like: cftry cfquery name=users datasource=#myDSN# SELECT user_id FROM users /cfquery cfcatch type=database !--- This could be our timeout issue, sleep for 2 seconds and try again --- cfset thisThread = CreateObject(java, java.lang.Thread) / cfset thisThread.sleep(2000) / cftry cfquery name=users datasource=#myDSN# SELECT user_id FROM users /cfquery cfcatch type=any !--- Rethrow the error as we cannot recover --- cfrethrow / /cfcatch /cftry /cfcatch /cftry HTH, Rich ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288363 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: CFQuery wrapper tag to help with poor connections to sql..
I have an app that has to use a connection that sees a few seconds of disconnectivity from its SQL server occasionaly. Dan, You can nest CFTRY's to accomplish this. Something like: cftry cfquery name=users datasource=#myDSN# SELECT user_id FROM users /cfquery cfcatch type=database !--- This could be our timeout issue, sleep for 2 seconds and try again --- cfset thisThread = CreateObject(java, java.lang.Thread) / cfset thisThread.sleep(2000) / cftry cfquery name=users datasource=#myDSN# SELECT user_id FROM users /cfquery cfcatch type=any !--- Rethrow the error as we cannot recover --- cfrethrow / /cfcatch /cftry /cfcatch /cftry HTH, Rich ~| ColdFusion is delivering applications solutions at at top companies around the world in government. Find out how and where now http://www.adobe.com/cfusion/showcase/index.cfm?event=finderproductID=1522loc=en_us Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288303 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFQuery wrapper tag to help with poor connections to sql..
Also remember the timeout attribute for cfquery. It accepts integers as seconds. cfquery name=users datasource=#myDSN# timeout=2 SELECT user_id FROM users /cfquery -- Wil Genovese One man with courage makes a majority. -Andrew Jackson A fine is a tax for doing wrong. A tax is a fine for doing well. Rich wrote: I have an app that has to use a connection that sees a few seconds of disconnectivity from its SQL server occasionaly. Dan, You can nest CFTRY's to accomplish this. Something like: cftry cfquery name=users datasource=#myDSN# SELECT user_id FROM users /cfquery cfcatch type=database !--- This could be our timeout issue, sleep for 2 seconds and try again --- cfset thisThread = CreateObject(java, java.lang.Thread) / cfset thisThread.sleep(2000) / cftry cfquery name=users datasource=#myDSN# SELECT user_id FROM users /cfquery cfcatch type=any !--- Rethrow the error as we cannot recover --- cfrethrow / /cfcatch /cftry /cfcatch /cftry HTH, Rich ~| ColdFusion is delivering applications solutions at at top companies around the world in government. Find out how and where now http://www.adobe.com/cfusion/showcase/index.cfm?event=finderproductID=1522loc=en_us Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288305 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4