[Dbix-class] Can't call method "storage"
Ryan VanderBijl
ryan-dbix at vbijl.net
Fri Jun 1 16:50:46 GMT 2007
> >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?
> >
>
> What version did it last work on?
This is new code. As far as I'm aware, it has never worked. I had not
used any relationships from IcAccount previously. Maybe it's worth
noting that the code that works runs in one request.
>
> >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"
> >
>
> Is this with Storable 2.15 or 2.16?
Yup. Gives me problems with both. With 2.16 I get:
[Fri Jun 1 16:48:58 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 339, 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"
(Object::Signature v1.05)
-Ryan
--
Ryan VanderBijl | http://vbijl.net/~ryan/
More information about the Dbix-class
mailing list