I think 

Select null
>From table

Is less taxing, and produces the same results

-- 
Scott Stewart
ColdFusion Developer
 
SSTWebworks
7241 Jillspring Ct.
Springfield, Va. 22152
(703) 220-2835
 
http://www.sstwebworks.com
-----Original Message-----
From: Brian Polackoff [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 20, 2007 1:02 PM
To: CF-Talk
Subject: RE: Testing Database Connection within Application

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






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275944
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to