On 1/12/06, Sean Davis <[EMAIL PROTECTED]> wrote:
> Cannot load ApacheAdmin::Model::User without a primary key (username) with a
> non-null value or another unique key with at least one non-null value. at
> test.pl line 9
>
> If I remove the inheritance from Catalyst::Model, everything works fine.
> It's not too big a deal in practice--I don't NEED the catalyst::model
> inheritance--but I'm curious why this doesn't work.

<SNIP>

> our @ISA = qw(Catalyst::Model Rose::DB::Object);

You are probably running into multiple inheritance problems.  Did you
try reversing the order of those modules in @ISA to see if you get the
same problem?

Catalyst::Model inherits from Catalyst::Component, which inherits from
Class::Accessor::Fast and Class::Data::Inheritable.  So if there is a
duplicated method that exists in Rose::DB::Object that also exists in
one of those modules, then your Rose::DB::Object instance will end up
calling the wrong method.  perl uses a depth first search to find
method names when using multiple inheritance, so anything in the
Catalyst::Model tree will take precidence over the methods in
Rose::DB::Object.

Catalyst uses 'NEXT' to forward calls in a lot of places, so some of
the method name conflicts 'may' still work, but any method that
doesn't use NEXT means the real Rose::DB::Object method will never be
called.

Cheers,

Cees


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to