cf doesn't handle this well at all.  I have a check in an app like the below.  The 
alivetest datasource has a short login timeout set on it.  If the DB is up but there 
is an issue, this works.  If the DB server is dead, as in off, or has disappeared, as 
in a network issue, this thing bombs.  It, as well as any connection to the DB when 
this happens, ties up threads and causes general mayhem.  I've thought about writing 
something that performs a ping/tnsping, but have not got to it.  Our DB goes down so 
rarely that its not a high priority for me.  This topic has seen some discussion 
before around here.

<cftry>
        <cfquery name="test" datasource="alivetest">
                select 42 as one from dual
        </cfquery>
        <cfcatch type="Any">
                do whatever

etc....

Doug


>-----Original Message-----
>From: Eric Creese [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, June 24, 2003 3:40 PM
>To: CF-Talk
>Subject: RE: Database Availability
>
>
>Wouldn't these boxes be out of sync then as far as data goes? 
>I would hope you are applying some type of replication.
>
>I think you could set something up in the application file and 
>run a simple query to return a output from your prod box. If 
>there is a connection problem then you would know when you did 
>not return a value. you would want to trap that error so the 
>page would not fail though.
>
>-----Original Message-----
>From: admin [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, June 24, 2003 2:34 PM
>To: CF-Talk
>Subject: Database Availability
>
>
>I hope that this isn't a stipid question but I'm sure it must 
>have been asked before.
>
>I have a two identical databases on different sql boxes. One 
>primary and one back up. I would like to be able to do 
>something like this in the application.cfm
>
><cfif primary_available>
><cfset use_database="primary">
><cfelseif Secondary_available>
><cfset use_database="secondary>
><cfelse>
>.... no database available
></cfif>
>
>Any thought on how I can easily check to see which box is available.
>
>Cheers
>
>Richard
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to