in reply to DBD::Sybase - How to reconnect through err_handler

I've never worked with Sybase, but I know that DBI has a connect_cached method. It checks a cached connection to find out if its dead before it opens a new connection. I use this often to ensure my db connections (MySQL, Oracle) are valid before running an operation.

It's a DBI method, so I suggest trying it:
my $dbh = DBI->connect_cached( ... );

Hope that helps.

Bro. Doug :wq

Replies are listed 'Best First'.
Re^2: DBD::Sybase - How to reconnect through err_handler
by jfroebe (Parson) on Nov 08, 2006 at 13:45 UTC

    Good idea, but the DBI->connect_cached() only really applies when you are attempting to make a connection. In my particular situation, where the db connection dies, I have to reconnect within the error handler routine (see the update to the OP for where we're at now).

    Thanks for the idea though :)

    Jason L. Froebe

    Team Sybase member

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1