Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
[Sun Nov 15 02:59:17 2009] [error] [client 0.0.0.1] DBI::db=HASH(0xc40 +d5a0)->disconnect invalidates 2 active statement handles (either dest +roy statement handles or call finish on them before disconnecting) at + /usr/lib/perl5/site_perl/5.8.8/Apache/Session/Lock/MySQL.pm line 90. [Sun Nov 15 02:59:20 2009] [error] [client 0.0.0.1] DBI::db=HASH(0xb1a +def0)->disconnect invalidates 2 active statement handles (either dest +roy statement handles or call finish on them before disconnecting) at + /usr/lib/perl5/site_perl/5.8.8/Apache/Session/Lock/MySQL.pm line 90.
however when I just pull a single Item I don't call any kind of finish:$sth = $dbh->prepare(qq{select * from `table`}); $sth->execute(); my $_var = $sth->fetchrow_hashref(); $sth->finish(); #<--- like this here...
at the end of the page loading I call a close to the html page which does this for every page load:my $_var = $dbh->selectrow_array(qq{select `column` from `table` where + `something` = ?}, undef, "somethingelse"); # Done getting $_var no database connection right, to close right?
The close command that the sess_ref uses is here:if($sess_ref) { $sess_ref->close(); # If there is a session open, close it } if($dbh) { $dbh->disconnect(); } print end_html();
sub close { my $self = shift; untie (%{$self}); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI disconnect database errors
by ikegami (Patriarch) on Nov 16, 2009 at 05:33 UTC | |
by Anonymous Monk on Nov 16, 2009 at 05:53 UTC | |
by dsheroh (Monsignor) on Nov 16, 2009 at 13:04 UTC | |
|
Re: DBI disconnect database errors
by EvanCarroll (Chaplain) on Nov 16, 2009 at 06:54 UTC | |
by Anonymous Monk on Nov 16, 2009 at 08:21 UTC | |
by mje (Curate) on Nov 16, 2009 at 09:05 UTC | |
by EvanCarroll (Chaplain) on Nov 16, 2009 at 15:55 UTC | |
by Anonymous Monk on Nov 16, 2009 at 16:51 UTC |