On 2/15/06, John C. Bland II <[EMAIL PROTECTED]> wrote:
> So, in the case of a simple query what happens if your datasource can't
> connect? (db down, etc) How do you handle this error with an open cfquery?
> onError in App.cfc?
>
> Just curious...
>

Well, like I said, if you can't connect to your database at all, then
you have bigger problems than whether or not a particular code snippet
works. This is where test probes should be written specifically to
ping your database every so often. We have a test set up using Nagios
that runs a probe that just hits our database every 15 seconds via a
ColdFusion page. We use Oracle, so the query is literally just:

SELECT
  sysdate
FROM
  dual

If that returns without issue, then all's fine. If our test page
doesn't return with the expected string (I won't reveal ours for
security reasons), then we know something's up and Nagios sends up the
appropriate alerts.

Remember that try/catch is at the code level for specific bits of
logic that you can reasonably forecast might not execute correctly for
a given reason. You need to have layers above your code base that run
the appropriate system checks to make sure things are up and running.
Using Nagios (which is an open source host, service and network
monitoring program, by the way) should be where you do your system
health checks over systems that you control.

Hope this helps?

Regards,
Dave.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232361
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to