[Dbix-class] Can't call method "storage"
Ryan VanderBijl
ryan-dbix at vbijl.net
Fri Jun 1 16:12:54 GMT 2007
Hi,
I'm getting the following error:
"Can't call method "storage" on an undefined value at
/usr/local/share/perl/5.8.8/DBIx/Class/ResultSource.pm line 442."
I'm using version DBIx::Class version 0.07006.
This is within a Catalyst application.
I have my schema setup with IcAccount, and IcGazetteer. The IcAccount
has_many IcGazetteer. Normally this works. E.g:
my $account = $c->model("db::IcAccount")->find({account_id => 1});
my @entries = $account->gazetteer_entries;
However, the following will produce the above error:
my $account = $c->model("db::IcAccount")->find({account_id => 1});
$c->session->{"account"} = $account;
# ... new page request
# Optional: doesn't work with or without:
# my $source = $c->model("db")->schema->source("IcAccount");
# $c->session->{"account"}->result_source( $source );
# or
# $c->session->{"account"}->set_simple( "result_source", $source );
my @entries = $c->session->{"account"}->gazetteer_entries;
Any suggestions?
Hmm, I also just noticed that this gives me an error:
my $account = $c->model("db::IcAccount")->find({account_id => 1});
my @entries = $account->gazetteer_entries;
$c->session->{"account"} = $account;
produces:
[Fri Jun 1 16:09:26 2007] [catalyst] [error] Caught exception in engine
"Can't store CODE items at blib/lib/Storable.pm (autosplit into
blib/lib/auto/Storable/_freeze.al) line 290, at
/usr/local/share/perl/5.8.8/DBIx/Class/Serialize/Storable.pm line 10, at
/usr/local/share/perl/5.8.8/Object/Signature.pm line 19"
Thanks!
-Ryan
--
Ryan VanderBijl | http://vbijl.net/~ryan/
More information about the Dbix-class
mailing list