Re: Database handle question in Sybperl

Michael Peppler <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
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
available. 

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
-- 
Michael Peppler  -  [email protected]  -  http://www.peppler.org/
Sybase DBA/Developer - TeamSybase: http://www.teamsybase.com/
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.