RE: CFQuery wrapper tag to help with poor connections to sql..

2007-09-13 Thread Daniel Baughman
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


CFQuery wrapper tag to help with poor connections to sql..

2007-09-12 Thread Daniel Baughman
Hi,
 
I have an app that has to use a connection that sees a few seconds of
disconnectivity from its SQL server occasionaly. I was consdiering writing a
wrapper tag to the CFQUERY that would try the query once, if it fails on
connection wait 2 seconds and try again, before failing.
 
Anyone done anything like this and had success?  Is there any way to over
ride builtin tags in coldfusion 8?
 
Regards,
Dan Baughman


~|
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:288287
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..

2007-09-12 Thread Rich
 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..

2007-09-12 Thread Wil Genovese
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