Rob,
This may sound simple, maybe too simple, but how long does your application
take to error on a cfquery if the table isn't available?
I useed a different approach, rather then testing to see if the DSN was
valid, I simply tried to query from it.
I have just ran into this problem myself and here's how if configured the
application. Hope it helps.
In application.cfm in the login code as I create all the session variables do
a..
<!--- checks to see if the reporting server is available --->
<cftry>
<!--- table has one record in it with 1 column --->
<cfquery datasource="rc-report" name="testconn">
Select * from testdsConn
</cfquery>
<cfset session.ds = 'rc-report'>
<cfcatch>
<cfset session.ds = 'rc-Live'>
</cfcatch>
</cftry>
<!----------------------------------------------------------------->
Again, hope it helps and sorry if this answer in some form has already been
given,
Brian
-----Original Message-----
From: Rob O'Brien [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 19, 2007 5:17 PM
To: CF-Talk
Subject: RE: Testing Database Connection within Application
>I tested shutting down my datasource, and it retured false in about 1-2
>seconds in my local environment.
This looks like exactly what I'm looking for and I really appreciate the
effort.
I tested the same way. I stop the SQL Server service and then refresh the
script.
Unfortunately, this still takes 16-18 seconds to return False (tested
locally). If you're reporting 1-2 seconds, I'm thinking there's another
factor involved. Any ideas?
Rob
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2
Build sales & marketing dashboard RIAâs for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275943
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4