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: "Lenga, Yair " <yair dot lenga at citi dot com>
Subject: Sybase not closing connection when scripts is terminated
Date: Aug 23 2007 12:04PM

Good Morning,

I using DBI-1.34/DBD-Sybase-0.95 to access Sybase servers, using Sybase
client 11.5.1, regular CGI/command line scripts (No Mod Perl, etc.).
Running against ASE

I'm trying to understand a problem that occur very infrequently (once
every 2 month, on a very busy server). Each time the problem occur on
different script, but the pattern is the same:
- Script get launched.
- Issuing a query that result in large results set - Read Only
- Script is aborted with Signal (or Ctrl/C).
- Script is terminated.
- Sybase Server does not detect that the script is not running any more
- READ ONLY locks remain from the query.
- Another scripts is running 12-24 hours later - trying to update/insert
- get locked forever.

At the time of the problem, Sybase is showing open connection (sp_who)
to the process. We verified that the process is not running on the
server (using ps), and does not have any forked children that may have
kept the connection open.

I suspect that the core problem is that Sybase server is unable to
detect closed connection, when it is in the middle of sending the result
set to the client, but I could not replicate the problem.

Any help with the following questions will be appreciated:
- Does anyone know/experience similar problem - and know the source ?
- Is there any setting that can be used to say "Abort transaction if it
can not be executed in  seconds" ?
- Any way to force Sybase to actively check if the client is alive every

Yair Lenga