Again: Can't locate object method "select_row" via package "DBI::st"
[prev]
[thread]
[next]
[Date index for 2005/05/10]
Hi list,
first post here.
I saw this error one month ago on this same mailinglist, but I didn't see a solution mentioned.
I am getting that same
Can't locate object method "select_row" via package "DBI::st"
error with my Class::DBI application (mod_perl).
Anyone a pointer to the solution?
My base class looks like this:
#!/usr/bin/perl
use warnings;
use strict;
use Inferno;
package Inferno::DBI;
use base 'Class::DBI';
my $hostname='127.0.0.1';
my $dbname='wijnand';
my $username='wijnand';
my $password='secret';
my $databasetype='Pg'; # Pg is postgresql (will be used later)
my $dsn = "DBI:$databasetype:host=$hostname;dbname=$dbname;port=5432";
# stolen from Class::DBI
{
my %Per_DB_Attr_Defaults = (
pg => { AutoCommit => 0 },
oracle => { AutoCommit => 0 },
);
sub _default_attributes {
my $class = shift;
return (
$class->SUPER::_default_attributes,
FetchHashKeyName => 'NAME_lc',
ShowErrorStatement => 1,
AutoCommit => 1,
ChopBlanks => 1,
RootClass => 'DBIx::ContextualFetch',
%{ $Per_DB_Attr_Defaults{ lc $class->__driver } || {} },
);
}
}
sub db_Main() # Stolen from Perrin Harkins
{
my $dbh;
if ( $ENV{'MOD_PERL'} and !$Apache::ServerStarting )
{
$dbh = Apache->request()->pnotes('dbh');
}
if ( !$dbh )
{
$dbh = DBI->connect_cached(
$dsn, $username,
$password, {PrintError => 0, RaiseError => 1}
);
if ( $ENV{'MOD_PERL'} and !$Apache::ServerStarting )
{
Apache->request()->pnotes( 'dbh', $dbh );
}
}
return $dbh;
}
|
Again: Can't locate object method "select_row" via package "DBI::st"
wwiersma 21:18 on 10 May 2005
|