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:
> 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 126.96.36.199 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.
email@example.com -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: firstname.lastname@example.org