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: 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, Matthew.Persico@Lazard.com 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?

[snip]

> 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:
http://nycux-tch102:8090/dynaweb/cng1110e/ctref/@ebt-link;pt=13116?target=%25N%
15_16792_START_RESTART_N%25

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.

Comments?

--
Matt