You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Grigory O. Ptashko" <tr...@bk.ru> on 2005/11/02 17:32:04 UTC

Apache::DBI + mod_perl 2.0.1. Please, help! Cannot get it work!

Hello, everybody.

I have:

FreeBSD 4.7
Apache 2.0.54
mod_perl 2.0.1
Apache::DBI 0.99 (taken from http://p6m7g8.net/Apache-DBI)

In my startup.pl I have:

use Apache::DBI ();
$Apache::DBI::DEBUG = 2;
Apache::DBI->connect_on_init("DBI:Pg:dbname=test", "test", "test",
{AutoCommit => 0, RaiseError => 1, PrintError => 0});


After startup, I see the following in error_log:
20297 Apache::DBI             PerlChildInitHandler
20298 Apache::DBI             PerlChildInitHandler
20299 Apache::DBI             PerlChildInitHandler
20300 Apache::DBI             PerlChildInitHandler
20301 Apache::DBI             PerlChildInitHandler
20308 Apache::DBI             PerlChildInitHandler

But!

When I run a simple registry script (it gives me the SELECT result,
the script itself is alright):
>8-------------------------------
#!/usr/bin/perl
use DBI;
print "Content-type: text/plaIn\n\n";
print "mod_perl 2.0 rocks!\n";
my $dbh = DBI->connect("DBI:Pg:dbname=test", "test", "test",
{AutoCommit => 0, RaiseError => 1, PrintError => 0});
my $sth = $dbh->prepare("SELECT id FROM test");
$sth->execute();
while (my ($id) = $sth->fetchrow_array())
{
      print $id . "\n";
}
$sth->finish();
>8--------------------------------

I don't see ANYTHING in my error_log file EXCEPT:

>8--------------
Issuing rollback() for database handle being DESTROY'd without explicit
disconnect() at
/usr/local/lib/perl5/site_perl/5.8.7/i386-freebsd/ModPerl/RegistryCooker.pm
line 203.
>8--------------


What does this mean? For it means that Apache::DBI is not used at all!
Am I wrong? I'm stuck.

How to get it work??

Thank you.


Re: Apache::DBI + mod_perl 2.0.1. Please, help! Cannot get it work!

Posted by Enno <bu...@xs4all.nl>.
reminds me not to respond while celebrating weekend with a bit of
white widow after 4 days of perl madness and isps not knowing why your
line is down. Sorry ;)

Enno

On Thu, 3 Nov 2005, Philip M. Gollucci wrote:

> Enno wrote:
> >>I don't see ANYTHING in my error_log file EXCEPT:
> I should have said that this was resolved.  Apache::Session was being
> used() in startup.pl before Apache::DBI A::S uses DBI.
>
> hence the problem.
>
>
> --
> END
> ------------------------------------------------------------
>      What doesn't kill us can only make us stronger.
>                  Nothing is impossible.
>
> Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
> Consultant / http://p6m7g8.net/Resume/
> Senior Developer / Liquidity Services, Inc.
>    http://www.liquidityservicesinc.com
>         http://www.liquidation.com
>         http://www.uksurplus.com
>         http://www.govliquidation.com
>         http://www.gowholesale.com
>
>


Re: Apache::DBI + mod_perl 2.0.1. Please, help! Cannot get it work!

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Enno wrote:
>>I don't see ANYTHING in my error_log file EXCEPT:
I should have said that this was resolved.  Apache::Session was being 
used() in startup.pl before Apache::DBI A::S uses DBI.

hence the problem.


-- 
END
------------------------------------------------------------
     What doesn't kill us can only make us stronger.
                 Nothing is impossible.
				
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
        http://www.liquidation.com
        http://www.uksurplus.com
        http://www.govliquidation.com
        http://www.gowholesale.com


Re: Apache::DBI + mod_perl 2.0.1. Please, help! Cannot get it work!

Posted by Enno <bu...@xs4all.nl>.
It looks like you're running things under cgi and not perl.

It'll help showing the modperl-handler configuration aswell.

B.

On Wed, 2 Nov 2005, Grigory O. Ptashko wrote:

> Hello, everybody.
>
> I have:
>
> FreeBSD 4.7
> Apache 2.0.54
> mod_perl 2.0.1
> Apache::DBI 0.99 (taken from http://p6m7g8.net/Apache-DBI)
>
> In my startup.pl I have:
>
> use Apache::DBI ();
> $Apache::DBI::DEBUG = 2;
> Apache::DBI->connect_on_init("DBI:Pg:dbname=test", "test", "test",
> {AutoCommit => 0, RaiseError => 1, PrintError => 0});
>
>
> After startup, I see the following in error_log:
> 20297 Apache::DBI             PerlChildInitHandler
> 20298 Apache::DBI             PerlChildInitHandler
> 20299 Apache::DBI             PerlChildInitHandler
> 20300 Apache::DBI             PerlChildInitHandler
> 20301 Apache::DBI             PerlChildInitHandler
> 20308 Apache::DBI             PerlChildInitHandler
>
> But!
>
> When I run a simple registry script (it gives me the SELECT result,
> the script itself is alright):
> >8-------------------------------
> #!/usr/bin/perl
> use DBI;
> print "Content-type: text/plaIn\n\n";
> print "mod_perl 2.0 rocks!\n";
> my $dbh = DBI->connect("DBI:Pg:dbname=test", "test", "test",
> {AutoCommit => 0, RaiseError => 1, PrintError => 0});
> my $sth = $dbh->prepare("SELECT id FROM test");
> $sth->execute();
> while (my ($id) = $sth->fetchrow_array())
> {
>       print $id . "\n";
> }
> $sth->finish();
> >8--------------------------------
>
> I don't see ANYTHING in my error_log file EXCEPT:
>
> >8--------------
> Issuing rollback() for database handle being DESTROY'd without explicit
> disconnect() at
> /usr/local/lib/perl5/site_perl/5.8.7/i386-freebsd/ModPerl/RegistryCooker.pm
> line 203.
> >8--------------
>
>
> What does this mean? For it means that Apache::DBI is not used at all!
> Am I wrong? I'm stuck.
>
> How to get it work??
>
> Thank you.
>
>