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: Closing a database connection
Date: Oct 14 1999 10:25PM

Michael Sweeney writes:
 > Hi,
 > 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
 > connection?
 > 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. 

The connection should get closed when the $dbh goes out of scope.

However, I agree that you sometimes need to be able to call ct_close() 
directly, and I'll add that to the next release.

Michael Peppler         -||-  Data Migrations Inc.    -||-
Int. Sybase User Group  -||-
Sybase on Linux mailing list: