Re: Class::DBI modules not properly loaded under mod_perl ?

[prev] [thread] [next] [Date index for 2004/10/22]

From: William McKee
Subject: Re: Class::DBI modules not properly loaded under mod_perl ?
Date: 15:41 on 22 Oct 2004
On Fri, Oct 22, 2004 at 12:55:23PM +0200, Michele Valzelli wrote:
> Operation `==': no method found, left argument in overloaded package 
> MyClass::Foo, right argument has no overloaded magic

Michele,

I saw this behavior when running extensive tests against a PostgreSQL
db. It had to do with the DBD driver not handling stringification (or
something along those lines). This problem should be fixed in the next
release of DBD::Pg.

In the meantime, Tim B. submitted some code to the list which fixed this
problem in CDBI. Here's the gist of it:

--- DBI.pm.orig 2004-06-21 13:39:58.000000000 -0400
+++ DBI.pm      2004-09-16 11:21:32.000000000 -0400
@@ -316,11 +316,11 @@
        # we don't use get() here because all objects should have
        # exisitng values for PK columns, or else loop endlessly
        my @pk_values = $self->_attrs($self->primary_columns);
-       return @pk_values if wantarray;
+  return map { "$_" } @pk_values if wantarray;
        $self->_croak(
                "id called in scalar context for class with multiple primary key columns")
                if @pk_values > 1;
-       return $pk_values[0];
+  return "$pk_values[0]";
 }



Good luck,
William

        -- 
        Knowmad Services Inc.
http://www.knowmad.com

(message missing)

pager
David R. Baird 09:48 on 20 Oct 2004

Re: pager
David R. Baird 13:53 on 20 Oct 2004

Re: pager
David R. Baird 21:00 on 20 Oct 2004

Re: pager
merlyn (Randal L. Schwartz) 02:55 on 21 Oct 2004

Re: pager
David R. Baird 10:46 on 21 Oct 2004

Re: pager
David R. Baird 11:30 on 21 Oct 2004

Re: pager
merlyn (Randal L. Schwartz) 12:10 on 21 Oct 2004

Re: pager
David R. Baird 23:08 on 21 Oct 2004

Re: pager
Cees Hek 00:22 on 22 Oct 2004

Re: pager
Tony Bowden 08:34 on 22 Oct 2004

Re: pager
Emanuele Zeppieri 13:51 on 22 Oct 2004

Re: pager
David R. Baird 14:41 on 22 Oct 2004

Re: pager
David R. Baird 09:20 on 22 Oct 2004

Class::DBI modules not properly loaded under mod_perl ?
Michele Valzelli 10:55 on 22 Oct 2004

Re: Class::DBI modules not properly loaded under mod_perl ?
William McKee 15:41 on 22 Oct 2004

Re: pager
Emanuele Zeppieri 12:21 on 22 Oct 2004

Re: pager
David R. Baird 12:52 on 22 Oct 2004

Re: pager
Emanuele Zeppieri 15:33 on 22 Oct 2004

Re: pager
David R. Baird 16:09 on 22 Oct 2004

Re: pager
David R. Baird 23:30 on 07 Nov 2004

RE: pager
Emanuele Zeppieri 03:50 on 14 Nov 2004

Re: pager
Emanuele Zeppieri 13:25 on 22 Oct 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52