Jules Beeston writes:
 > We are using Apache mod_perl, DBI and DBD::Sybase to connect to our Sybase
 > db.
 > Even though we are opening connections and then closing connections the
 > TCP/IP connections are staying in an ESTABLISHED state for a long unknown
 > period of time.
 > From looking at the DBD::Sybase disconnect code, it appears that the
 > disconnect is not implemented (please correct me if I am wrong about this).

I believe that you are:

The following little script does call disconnect (and ct_close()):

#!/usr/local/bin/perl -w

use DBI;

DBI->trace(3);

$dbh = DBI->connect('dbi:Sybase:kiruna', 'sa', '');

$dbh->disconnect;

Trace log:

    New DBI::db (for DBD::Sybase::db, parent=DBI::dr=HASH(0x819d914), id=)
    dbih_setup_handle(DBI::db=HASH(0x819d884)=>DBI::db=HASH(0x819d7e8), 
DBD::Sybase::db, 814fe7c, Null!)
    dbih_make_com(DBI::dr=HASH(0x819d914), DBD::Sybase::db, 2212)
    syb_db_login() -> checking for chained transactions
    syb_db_login() -> chained transactions are  supported
    <- connect= DBI::db=HASH(0x819d884) at DBI.pm line 416.
    -> STORE for DBD::Sybase::db (DBI::db=HASH(0x819d7e8)~INNER 'PrintError' 1)
    STORE DBI::db=HASH(0x819d7e8) 'PrintError' => 1
    <- STORE= 1 at DBI.pm line 441.
    -> STORE for DBD::Sybase::db (DBI::db=HASH(0x819d7e8)~INNER 'AutoCommit' 1)
    <- STORE= 1 at DBI.pm line 441.
    <- connect= DBI::db=HASH(0x819d884)
    -> disconnect for DBD::Sybase::db (DBI::db=HASH(0x819d884)~0x819d7e8)
    syb_db_disconnect() -> ct_close()
    <- disconnect= 1 at disconnect.pl line 9.

It seems to me that what is happening is that your handle doesn't get
destroyed, probably due to incorrect coding wrt modperl issues.

I've done connection pooling with Apache & modperl (but not with
DBI). Email me directly if you want to talk about that.

Michael
-- 
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
[EMAIL PROTECTED] - [EMAIL PROTECTED]
International Sybase User Group - http://www.isug.com

Reply via email to