Hi all,

while calling $dbh->disconnect() at the end of my database operations, I get the warning that there are still active statement handles. But when I ckeck it I could not see any active statement handles. Any ideas how this could happen?

Here is the output of my debugging:

-----------------
Kids before disconnecting: 6
Active Kids before disconnecting: 0
drh  DBI::dr=HASH(0x8426eb4) 1
dbh      DBI::db=HASH(0x8a909a8) 1
sth              DBI::st=HASH(0x8a94a3c)
sth              DBI::st=HASH(0x8ae6364)
sth              DBI::st=HASH(0x8ae6100)
sth              DBI::st=HASH(0x8ae5f44)
sth              DBI::st=HASH(0x8ae63c4)
sth              DBI::st=HASH(0x8ae658c)
closing dbh with active statement handles at /path/to/script/queryexdb_dyn.cgi line 717.
-----------------

And here ist the code which prints the above lines in my error-log:

########
warn "Kids before disconnecting: ".$dbh->{Kids}."\n";
warn "Active Kids before disconnecting: ".$dbh->{ActiveKids}."\n";

sub show_child_handles {
        my ($h, $level) = @_;
        warn sprintf "%sh %s %s %s\n", $h->{Type}, "\t" x $level, $h, 
$h->{Active};
        show_child_handles($_, $level + 1)
            for (grep { defined } @{$h->{ChildHandles}});
}

my %drivers = DBI->installed_drivers();
show_child_handles($_, 0) for (values %drivers);

$dbh->disconnect();
########

And at last here the stats about my environment:

Perl, v5.8.8 built for i586-linux-thread-multi (SuSe-Linux, kernel 2.6.18)
DBI 1.52
DBD::SQLite 1.13


Greetings

Robert

Reply via email to