Randolf Richardson
2006-02-16 23:48:39 UTC
I'm running NetWare 6.5 and Apache v2.0.55 with ModPerl. One of my
scripts use DBD::PgPP (the PostgreSQL Pure-Perl module) to connect to a
remote host running PostgreSQL v8.x.
Under ModPerl, I get the following error in my error logs when the script
attempts to connect (the connection always fails, cached or not):
1: ModPerl::Registry: dbih_getcom given an undefined handle (perhaps
returned from a previous call which failed) at sys:perllib/DBI.pm line 601.
Running the same script on the same server from the System Console (PERL
v5.8.4 is installed on the system) works properly. All of my other
scripts (none of which are using DBI) are working correctly, thus ModPerl
seems to be fine.
Included below is the script I'm trying to get working under ModPerl (with
passwords changed so as not to reflect reality).
All suggestions are welcome. Thanks in advance.
----------------------
use DBI;
print "Content-type: text/htmlnn";
my $db = 'dbi:PgPP:dbname=template1;host=10.1.1.253';
print "<p>Connecting to $db...n";
my $dbh = DBI->connect_cached($db,'postgres','manager');
# -x- Under ModPerl this script fails before reaching this point.
print "<p>Preparing SQL statement...n";
my $sth = $dbh->prepare_cached('select * from pg_ts_cfg');
print "<p>Executing SQL statement...n";
$sth->execute;
print "<p>Fetching rows...n<p>";
while (my $row = $sth->fetchrow_hashref) {
print $row->{'ts_name'},"<BR>n";
}
scripts use DBD::PgPP (the PostgreSQL Pure-Perl module) to connect to a
remote host running PostgreSQL v8.x.
Under ModPerl, I get the following error in my error logs when the script
attempts to connect (the connection always fails, cached or not):
1: ModPerl::Registry: dbih_getcom given an undefined handle (perhaps
returned from a previous call which failed) at sys:perllib/DBI.pm line 601.
Running the same script on the same server from the System Console (PERL
v5.8.4 is installed on the system) works properly. All of my other
scripts (none of which are using DBI) are working correctly, thus ModPerl
seems to be fine.
Included below is the script I'm trying to get working under ModPerl (with
passwords changed so as not to reflect reality).
All suggestions are welcome. Thanks in advance.
----------------------
use DBI;
print "Content-type: text/htmlnn";
my $db = 'dbi:PgPP:dbname=template1;host=10.1.1.253';
print "<p>Connecting to $db...n";
my $dbh = DBI->connect_cached($db,'postgres','manager');
# -x- Under ModPerl this script fails before reaching this point.
print "<p>Preparing SQL statement...n";
my $sth = $dbh->prepare_cached('select * from pg_ts_cfg');
print "<p>Executing SQL statement...n";
$sth->execute;
print "<p>Fetching rows...n<p>";
while (my $row = $sth->fetchrow_hashref) {
print $row->{'ts_name'},"<BR>n";
}