[Catalyst] Model::DBIC not working? Because of DBIx::Class::Loader?

Matt S Trout dbix-class at trout.me.uk
Wed Nov 2 14:33:54 CET 2005


On Wed, Nov 02, 2005 at 12:49:36PM +0000, Jules Bean wrote:
> Now that's weird, so I look at DBIC.pm, and I notice the following 
> auxiliary problem. Clearly $self->loader must be null, but that means 
> the eval is failing? So why am I not seeing those debug messages? 
> Apparently $c->log->debug doesn't work this early in the setup cycle. So 
> I put in some print STDERRs there into DBIC.pm and I find that the real 
> error (the contents of $@ after the eval) is:
> 
> Can't locate object method "storage" via package 
> "DBIx::Class::Loader::Pg" at /Library/Perl/5.8.6/DBIx/Class/Loader/Pg.pm 
> line 95.
> 
> OK now that's weird. I chased around the code in DBIx::C::L::Pg for a 
> while but I couldn't fully grok the inheritance strategy of 
> DBIx::Class::Componentised. It seems that 'storage' lies in 
> DBIx::C::DB.pm, but that never ends up on the ISA stack of 
> DBIx::C::L::Pg but I don't know how it is supposed to get on the ISA 
> stack and why it doesn't.

Componentised doesn't have an inheritance strategy really, it's a convenient
way to *manage* inheritance strategies for things.

Loader should set up a common base class for the table classes that's
isa DBIx::C::DB and has the storage info set on it. This is pretty much
the same as what compose_connection from DBIx::C::Schema does (although
Schema does some extra magic to put the thing in its new namespace, of
course)

-- 
     Matt S Trout       Specialists in Perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list