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

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

am 02.11.2005 16:58:59 von trancer

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");


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");
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/Re gistryCooker.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.