PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

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
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  -  mpeppler@peppler.org  -  http://www.peppler.org/
Sybase DBA/Developer - TeamSybase: http://www.teamsybase.com/
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html