[Dbix-class] caching objects along with other data in Cache::*

J. Shirley jshirley at gmail.com
Tue May 6 17:50:46 BST 2008


On Tue, May 6, 2008 at 3:19 AM, Aaron Trevena <aaron.trevena at gmail.com> wrote:
> Hi All,
>
>  I have a lot of objects that are fairly expensive to fetch (large
>  trees of records), and so I'm caching them using Cache::* (via a handy
>  abstraction layer that allows me to swap to libmemcached or swifty if
>  necessary).
>
>  So far it JustWorks(TM), I put stuff in the file cache, I get it out
>  later, prefetched relationships work fine - I do absolutely no
>  serialization or anything, Cache::* handles it all for me.
>
>  When I mentioned this on irc, there was talk of needing to get the
>  schema to dethaw stuff, but everything I have is already
>  deserialized/thawed and mostly ready to go - so how would I refresh db
>  connections/schema for an object after it's been deserialzed by
>  Cache::* ?
>
>
>  Anybody? Bueller?
>
>  A.
>

All the heavy lifting is done for you:
http://search.cpan.org/~ash/DBIx-Class-0.08010/lib/DBIx/Class/Serialize/Storable.pm

It's worth a read of the source to figure out what is going on though.

-J



More information about the DBIx-Class mailing list