How to reconnect a dead DBD::Sybase Connection
on Nov 08, 2006 at 20:11 UTC
by jfroebe

It is important to know that this is just one method of reconnecting a dead connection.  Note that we are handling the errors manually for the individual query.  It wouldn't take much to create a db_exec subroutine so we just call the db_exec() subroutine and just worry about the reconnect in one place.

Notice that because of DBD::Sybase bug # 616, the error 151 will be printed to STDERR.

./test_sybase OpenClient message: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = ( +151) Message String: ct_cancel(): user api layer: external error: A connect +ion to the server must exist on the connection structure before this +routine can be called. ERROR: Connection to DBMS died syb_db_disconnect(): ct_close() failed MSG: Reconnected