Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Database handle question in Sybperl
Date: Nov 1 2005 7:17PM
On Tue, 2005-11-01 at 17:49 +0000, Alan Olsen wrote:
> I am using the latest version of Sybase::CTlib.
> I have a piece of code that will have a database handle passed to it.
> I want to be able to check the status of the handle. I need to know if
> it is connected, has any pending requests, is dead or deadlocked and
> anything else of use before I try to feed new requests to it.
Unfortunately there isn't very much information in the handle at the
moment to tell you if there are any results pending, or if the handle is
I suppose that you could create a new class and overload the
ct_results() call. For any operation the handle stays busy until
ct_results() stops returning CS_SUCCEED...
And FYI the handle is a tied hash, done in a pretty ugly way (I wrote
that code almost 10 years ago now...)
There may be other ways, but they probably require getting at the CTlib
API (which Sybase::CTlib is usually pretty good at, of course)
Michael Peppler - firstname.lastname@example.org - http://www.peppler.org/
Sybase DBA/Developer - TeamSybase: http://www.teamsybase.com/
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html