You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Philip Mak <pm...@aaanime.net> on 2000/12/28 09:39:43 UTC

Issuing rollback() for database handle being DESTROY'd

I recently noticed some strange error messages in my error_log. This is
from animelyrics.com, which uses Apache::ASP and MySQL.

Issuing rollback() for database handle being DESTROY'd without explicit
disconnect() at (eval 9) line 22.

The above line keeps repeating over and over in the error log. There are
two things that confuse me...

(1) I never use rollback() anywhere in my code... so I'm wondering if
something else could cause a rollback.

(2) The "(eval 9) line 22" message doesn't tell me what file the error is
in. The modperl guide suggested adding the following lines to my perl
startup file so that the messages would show the correct file:

use Carp ();
local $SIG{__WARN__} = \&Carp::cluck;

...but they don't seem to have any effect after I added them and did an
"apachectl restart".

-Philip Mak (pmak@aaanime.net)


Re: Issuing rollback() for database handle being DESTROY'd

Posted by Joshua Chamas <jo...@chamas.com>.
Philip Mak wrote:
> 
> I recently noticed some strange error messages in my error_log. This is
> from animelyrics.com, which uses Apache::ASP and MySQL.
> 
> Issuing rollback() for database handle being DESTROY'd without explicit
> disconnect() at (eval 9) line 22.
> 

This implies that you have a database handle that is destroyed 
in the scope of running your program.  Then it would seem that you
are not using Apache::DBI?  I don't think I get this error when 
I start using Apache::DBI.  Remember to load Apache::DBI before DBI.

]# perl -MDBI -e 'DBI->connect(qw(dbi:mysql:host=...), qw(root))';
Issuing rollback() for database handle being DESTROY'd without explicit disconnect().

Apache::DBI keeps a connection cached so that it won't close until
your apache child exits.  It probably then issues a disconnect itself.

> 
> (1) I never use rollback() anywhere in my code... so I'm wondering if
> something else could cause a rollback.
> 

Note with above, its probably just DBI that does it.

> (2) The "(eval 9) line 22" message doesn't tell me what file the error is
> in. The modperl guide suggested adding the following lines to my perl
> startup file so that the messages would show the correct file:
> 
> use Carp ();
> local $SIG{__WARN__} = \&Carp::cluck;
> 
> ...but they don't seem to have any effect after I added them and did an
> "apachectl restart".
> 

Does:

  use Carp ();
  $SIG{__WARN__} = \&Carp::cluck;

that work better after a stop/start? 

-- Josh

Re: Issuing rollback() for database handle being DESTROY'd

Posted by Victor Michael Blancas <vb...@yahoo.com>.
> I recently noticed some strange error messages in my error_log. This is
> from animelyrics.com, which uses Apache::ASP and MySQL.
>
> Issuing rollback() for database handle being DESTROY'd without explicit
> disconnect() at (eval 9) line 22.
>
> The above line keeps repeating over and over in the error log. There are
> two things that confuse me...
>
> (1) I never use rollback() anywhere in my code... so I'm wondering if
> something else could cause a rollback.
>
I get the same problem if I don't explicitly disconnect from the database.
You can ignore this problem if you're just making SELECT queries.  Also if
the MySQL version you're using doesn't use transactions then it
autocommits data by default.  DBI is also autocommit by default.  If
you're annoyed by the error.  put a 'dbh->disconnect' at the end of your
scripts.

> (2) The "(eval 9) line 22" message doesn't tell me what file the error is
> in. The modperl guide suggested adding the following lines to my perl
> startup file so that the messages would show the correct file:
>
> use Carp ();
> local $SIG{__WARN__} = \&Carp::cluck;
>
> ...but they don't seem to have any effect after I added them and did an
> "apachectl restart".
>
> -Philip Mak (pmak@aaanime.net)
>
> .
>  Mak (pmak@aaanime.net)
>
> .
>

-- 
Mike