On Fri, 26 May 2000, amy wrote:
> ##  second error
> DBI::db=HASH(0x1ff304)->disconnect invalidates 1 active
> statement handle (either destroy statement handles or call
> finish on them before disconnecting) at
> /usr/local/bin/apache/cgi-bin/lib.pl line 41.
> ##

I avoid this type of error by pushing a cleanup handler to take care of
it, like this: 

sub finisher {
    while ((my $key, my $sth) =
           each %{$dbh->{'CachedKids'}}) {
        $sth->finish();
    }
}

I call finish on my statements explicitly when I can, but if something
exits in an irregular way (i.e. before I was able to call finsih) this
handler will take care of it.

Maybe this should be folded into Apache::DBI, like the automatic rollback?

- Perrin

Reply via email to