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
> 

Reply via email to