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: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Timeouts
Date: Jan 3 2003 4:58PM

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?
> Our situation is that we have two competing processes that sometimes deadlock,
> which we can detect and retry.
> Other times, one process gets the lock and the other waits forever. We'd rather
> detect the page/table  lock, and abort the statement.
> If we cannot detect the page/table lock, we want to set a timeout on the
> statement.

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).

Once a timeout has been seen you should cancel the request (probably via
$sth->finish) (although the default error handler may already do this
for you...)

Michael Peppler                              Data Migrations, Inc.       
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or 
long term contract positions -