You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Alec Smith <al...@shadowstar.net> on 2001/04/05 05:49:17 UTC
Problem with Apache::DBI
Issuing rollback() for database handle being DESTROY'd without explicit
disconnect() at /usr/lib/perl5/site_perl/5.005/Apache/DBI.pm line 139.
Using Apache::DBI 0.88+DBI 1.14+mod_perl 1.25+MySQL 3.23.36 I'm getting the
above in my error_log and am not sure why. Any ideas? I do have a
$db->disconnect; line in my modules.
Just a tad lost,
Alec
Re: Problem with Apache::DBI
Posted by Cees Hek <ce...@sitesuite.net>.
On Thu, 5 Apr 2001, Alec Smith wrote:
> In my module I've got:
>
> use DBI;
> use Apache::DBI;
> $db = DBI->connect('DBI:mysql:dbname', 'username', 'password', {RaiseError
> => 1, AutoCommit => 1});
Have a read of the Apache::DBI man page and it will explain what is wrong
here.
You don't need to add Apache::DBI in your module.
> and in startup.pl:
>
> use DBI;
> use Apache::DBI;
> Apache::DBI->connect_on_init('DBI:mysql:dbname', 'username',
> 'password',{RaiseError => 1, AutoCommit => 1});
The use Apache::DBI should come bofore the use DBI call. In fact, the use
Apache::DBI should come before you load any DBI enabled modules in you
config files.
Cees Hek
>
> yet I'm still seeing the error
>
> Issuing rollback() for database handle being DESTROY'd without explicit
> disconnect() at /usr/lib/perl5/site_perl/5.005/Apache/DBI.pm line 139.
>
> in the logs.
>
> Still lost,
> Alec
>
>
> At 09:24 AM 4/5/01 +0100, you wrote:
> >You would only get that message if AutoCommit was off.
> >It should not be off for DBD::mysql (since it doesn't yet support
> >the transaction features of newer versions).
> >
> >Plus, disconnect doesn't do anything when using Apache::DBI
> >(by design).
> >
> >Tim.
> >
> >On Wed, Apr 04, 2001 at 11:49:17PM -0400, Alec Smith wrote:
> > > Issuing rollback() for database handle being DESTROY'd without explicit
> > > disconnect() at /usr/lib/perl5/site_perl/5.005/Apache/DBI.pm line 139.
> > >
> > > Using Apache::DBI 0.88+DBI 1.14+mod_perl 1.25+MySQL 3.23.36 I'm getting
> > the
> > > above in my error_log and am not sure why. Any ideas? I do have a
> > > $db->disconnect; line in my modules.
> > >
> > > Just a tad lost,
> > > Alec
>
>
>
--
Cees Hek
SiteSuite Corporation
cees@sitesuite.net
Re: Problem with Apache::DBI
Posted by Alec Smith <al...@shadowstar.net>.
In my module I've got:
use DBI;
use Apache::DBI;
$db = DBI->connect('DBI:mysql:dbname', 'username', 'password', {RaiseError
=> 1, AutoCommit => 1});
and in startup.pl:
use DBI;
use Apache::DBI;
Apache::DBI->connect_on_init('DBI:mysql:dbname', 'username',
'password',{RaiseError => 1, AutoCommit => 1});
yet I'm still seeing the error
Issuing rollback() for database handle being DESTROY'd without explicit
disconnect() at /usr/lib/perl5/site_perl/5.005/Apache/DBI.pm line 139.
in the logs.
Still lost,
Alec
At 09:24 AM 4/5/01 +0100, you wrote:
>You would only get that message if AutoCommit was off.
>It should not be off for DBD::mysql (since it doesn't yet support
>the transaction features of newer versions).
>
>Plus, disconnect doesn't do anything when using Apache::DBI
>(by design).
>
>Tim.
>
>On Wed, Apr 04, 2001 at 11:49:17PM -0400, Alec Smith wrote:
> > Issuing rollback() for database handle being DESTROY'd without explicit
> > disconnect() at /usr/lib/perl5/site_perl/5.005/Apache/DBI.pm line 139.
> >
> > Using Apache::DBI 0.88+DBI 1.14+mod_perl 1.25+MySQL 3.23.36 I'm getting
> the
> > above in my error_log and am not sure why. Any ideas? I do have a
> > $db->disconnect; line in my modules.
> >
> > Just a tad lost,
> > Alec
Re: Problem with Apache::DBI
Posted by BeerBong <al...@samara.net>.
I have exactly the same errors in my log.
AutoCommit not specified in connect method, therefore 'on' by default.
Now, specify AutoCommit explicitly and wait for errors.
---------------------------------------------
Sergey Polyakov aka "BeerBong"
Chief of WebZavod http://www.webzavod.ru
Tel. +7 (8462) 43-93-85 | +7 (8462) 43-93-86
mailto:alexei@samara.net
----- Original Message -----
From: "Tim Bunce" <Ti...@ig.co.uk>
To: "Alec Smith" <al...@shadowstar.net>
Cc: <mo...@apache.org>
Sent: Thursday, April 05, 2001 12:24 PM
Subject: Re: Problem with Apache::DBI
> You would only get that message if AutoCommit was off.
> It should not be off for DBD::mysql (since it doesn't yet support
> the transaction features of newer versions).
>
> Plus, disconnect doesn't do anything when using Apache::DBI
> (by design).
>
> Tim.
>
> On Wed, Apr 04, 2001 at 11:49:17PM -0400, Alec Smith wrote:
> > Issuing rollback() for database handle being DESTROY'd without explicit
> > disconnect() at /usr/lib/perl5/site_perl/5.005/Apache/DBI.pm line 139.
> >
> > Using Apache::DBI 0.88+DBI 1.14+mod_perl 1.25+MySQL 3.23.36 I'm getting
the
> > above in my error_log and am not sure why. Any ideas? I do have a
> > $db->disconnect; line in my modules.
> >
> > Just a tad lost,
> > Alec
>
Re: Problem with Apache::DBI
Posted by te...@blackhole.acon.nl.
Similar problem here but not quite
First time now I want to use a database handler more persistent.
Not yet by using Apache::DBI but in a global $DBH
Shouldn't this just work?
I did not put Apache::DBI in startup file
I also tried code outside handler and I tried server restarts.
I always get a server has gone
use DBI ();
use Apache::Reload;
use vars qw($DBH $DB_TABLE $ID_LENGTH, %SESSION);
sub handler {
my $r = shift;
$DBH = DBI->connect(DSN,undef,undef) unless defined($DBH) ;
or: $DBH ||= DBI->connect(DSN,undef,undef) unless defined($DBH) ;
my $bla = $DBH->do("select 1 from $DB_TABLE");
[Thu Apr 5 12:33:21 2001] null: DBD::mysql::db do failed: MySQL server
has gone away at /usr/local/apache/lib/perl/Navvy/NavvyLijst.pm line 59.
Arnold
On Thu, 5 Apr 2001, Tim Bunce wrote:
> You would only get that message if AutoCommit was off.
> It should not be off for DBD::mysql (since it doesn't yet support
> the transaction features of newer versions).
>
> Plus, disconnect doesn't do anything when using Apache::DBI
> (by design).
>
> Tim.
>
> On Wed, Apr 04, 2001 at 11:49:17PM -0400, Alec Smith wrote:
> > Issuing rollback() for database handle being DESTROY'd without explicit
> > disconnect() at /usr/lib/perl5/site_perl/5.005/Apache/DBI.pm line 139.
> >
> > Using Apache::DBI 0.88+DBI 1.14+mod_perl 1.25+MySQL 3.23.36 I'm getting the
> > above in my error_log and am not sure why. Any ideas? I do have a
> > $db->disconnect; line in my modules.
> >
> > Just a tad lost,
> > Alec
>
Re: Problem with Apache::DBI
Posted by Tim Bunce <Ti...@ig.co.uk>.
You would only get that message if AutoCommit was off.
It should not be off for DBD::mysql (since it doesn't yet support
the transaction features of newer versions).
Plus, disconnect doesn't do anything when using Apache::DBI
(by design).
Tim.
On Wed, Apr 04, 2001 at 11:49:17PM -0400, Alec Smith wrote:
> Issuing rollback() for database handle being DESTROY'd without explicit
> disconnect() at /usr/lib/perl5/site_perl/5.005/Apache/DBI.pm line 139.
>
> Using Apache::DBI 0.88+DBI 1.14+mod_perl 1.25+MySQL 3.23.36 I'm getting the
> above in my error_log and am not sure why. Any ideas? I do have a
> $db->disconnect; line in my modules.
>
> Just a tad lost,
> Alec