You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Homsher, Dave V." <DV...@bemis.com> on 2000/10/03 13:02:12 UTC

Apache::Sybase::CTlib connections dropping (not morning issue)

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?

Thanks in advance for any help ...

Dave Homsher,
Webmaster
MACtac IT

-- It's always darkest just before it goes pitch black. 

Re: Apache::Sybase::CTlib connections dropping (not morning issue)

Posted by Michael Peppler <mp...@peppler.org>.
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.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com