Not sure if the is a Catalyst or DBIC question.

Catalyst::Model::DBIC::Schema returns objects blessed into classes related
to the app.  Then the problem is I cannot share (cached) objects across
applications.


I have a set of DBIC classes "MySchema".   I have an often used and
expensive query where I cache the returned rows.  So, a row object like
this:

$schema->resultset( 'Account' )->find( 123 );


ends up blessed into "MySchema::Result::Account".   When row objects are
cached the class name is stored so it can be thawed back into that class,
of course.


Now,  I have an app "MyApp" that uses Catalyst::Model::DBIC::Schema to
access "MySchema".  In this case row objects are blessed into:

MyApp::Model::MyDB::Account.


And that's the name that is serialized when freezing.   The problem is
another app "OtherApp" also uses the DBIC MySchema class and when it
fetches a cached entry it tries to bless them into
MyApp::Model::MyDB::Account which it cannot do.  (Needs to thaw into
"OtherApp::Model::MyDB::Account".)

    Error:  Can't locate MyApp/Model/MyDB/Account.pm in @INC


Any ideas what might be done here, short of not storing the DBIC row
objects?   I do want to end up with row objects after thawing, so they can
be used just as if I had done the query directly.


-- 
Bill Moseley
mose...@hank.org
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to