[Catalyst] storing a list of items into the session
Pierre Moret
pierre at sw2.ch
Mon Mar 24 00:07:19 GMT 2008
Guillermo Roditi wrote:
> You are trying to store a resultset into the session. I made this same
> mistake when I started using catalyst, don't worry. What's happening
> is that your object is being serialized in between page views and you
> are losing the DB connection there.
Ok, I understand. Thanks for the explanation!
> DBIC allows you to freeze and thaw
> objects and restore connections pretty easily, see the POD in
> DBIx::Class::Schema for more info. I know that the object you got
> using find() appears to work, but relationships will be broken. Either
> properly freeze and thaw objects, or fetch them in every request.
Had a quick first look at that, but I'll need a longer second one in
order to really understand how this works... ;-)
Following Stephen's suggestion, I now have exactly the behavior I
wanted. Good. But is this good practice or would be the freeze/thaw
method 'cleaner' and more 'Catalyst-conform'?
--Pierre
PS: thanks again for the super-quick reaction time, guys! Amazing...
More information about the Catalyst
mailing list