Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: persicom at acedsl dot com
Subject: Re: Timeouts
Date: Jan 3 2003 6:09PM

Quoting Michael Peppler :

> On Fri, 2003-01-03 at 08:34, wrote:
> > Is there a way, with DBD::Sybase, on a statement handle level, to either
> detect
> > a lock or set a timeout on a statement execution?


> See the "timeout" connection property.
> However I realize now that this should really be a database handle
> attribute, settable as needed (right now you can only set this at
> DBI->connect() time, unfortunately).

Before we go off and start patching, consider the following...

Here is the underlying CTLib doc on timeouts:

In particular:

"ct_config can be called to set the timeout value before or after a call to 
ct_connect creates an open connection. It takes effect for all open connections 
immediately upon being called."

Is this the way it works now at the dbhandle level? Does the timeout get 
applied to all currently open handles? Subsequently opened handles?

If we were to implement this on a statement handle level, the programmer would 
have to 

1) Set the appropriate $sth attribute with a function call. The call would have 
to return the current value, which the programmer would have to store.
2) $sth->prepare, execute or $sth->do.
3) Reset the attribute to the original stored value.
4) $sth-fetch to process rows.

Otherwise, all subsequent executions on ANY open database handle would be 
subject to the timeout. 

Seems to me that this pretty much rules out using this in a multi-threaded 
program OR a pooled connection environment.