Homsher, Dave V. writes:
> Hi all,
>
> I have an unstable connection to my backend database (I have no control).
> The connection often blinks which causes the Apache children processes to
> drop. I am trying to figure out a way to automatically reconnect.
>
> I am currently writing a script to run outside of Apache which will make a
> connection. When the connection blinks, the script will gracefully restart
> the server. There has to be a way to do this within the mod_perl environment
> - Any ideas?
Not really a modperl issue... however:
You need to check the error handler for the DBDEAD status. If that is
set you need to reconnect. However, this check needs to be done after
each call to a CTlib API call.
In general I do something like this: wrap all my CTlib API calls in a
generic interface which checks this (and other) error conditions, and
reconnects as necessary.
Michael
--
Michael Peppler -||- Data Migrations Inc.
[EMAIL PROTECTED] -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: [EMAIL PROTECTED]