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 Sweeney <michael at IS dot CO dot ZA>
Subject: Closing a database connection
Date: Oct 14 1999 8:49PM


I have a perl process that processes a continuous datafeed and inserts
data into a Sybase database as it arrives. The inserts are done by calling
stored procedures in the database using sybperl. Every few days my process
will start hanging. I have done some debugging using strace on both the
dabase server and on my process and it appears to be a problem in the
database. When a hang occurs it seems that after the stored procedure
call, the database doesnt return anything to the client application and
my process is left hanging in a select.

A colleague has suggested putting a SIGALRM handler into my client
application to close and then reopen the database connection if a hang
occurs. Problem is I am using CTlib and have not been able to find an
explicit way of closing the connection. Is there any easy way to close a

Setup Information:
I am currently using Sybase for Linux so there is no support
available from Sybase. My application program running on a Linux box with
kernel 2.2.5, Perl 5.005_02 and sybperl 2.10.