class::dbi and storing/thawing?

Brad Fitzpatrick brad@danga.com
Mon, 3 May 2004 11:47:56 -0700 (PDT)


Cache::Memcached just uses Storable, so if that can't freeze/thaw things
properly, neither can Cache::Memcached.

I suspect the problem with Class::DBI is that it holds some of its
attributes in package globals or hangs onto $dbh references which are no
longer valid after unthawing.

I'd whip up a wrapper script using Storable and submit a failing test-case
to the Class::DBI maintainers, asking them why it's not serializable.

- Brad


On Mon, 3 May 2004, Ken Burcham wrote:

> Hi memcached gurus,
>
>   I'm giving memcached a spin and can store a hitcounter (what
> fun) but when I try to store what I'm really after, Class::DBI
> (http://search.cpan.org/~tmtm/Class-DBI-0.96/lib/Class/DBI.pm)
> objects, I get no joy.  Class::DBI objects have methods and
> attributes, and neither work after 'set'ing and 'get'ing one in
> memcached.
>
> Here's the error:
>
> [Mon May 03 14:33:44 2004] [error] [client 10.10.20.41] Can't
> locate object method "languagecode" via package
> "GCX::Runtime::Input::Table::global::community" at
> /usr/lib/perl5/site_perl/5.8.0/GCX/Runtime/Output/Handler.pm line
> 122, <Sock_172.16.1.123:11211> line 1.
>
> The object works fine before I store it, i.e. i can use the
> languagecode method, etc.
>
> So my question, I guess, is about the storing and thawing...
> What sorts of limitations are there?  Or what kinds of objects
> can I store and what kinds can't I?  Sorry if this is a FAQ, I
> didn't see one...  Happy to be pointed in the right direction!
>
> thanks so much!
>
> ken.
>
> --
> Ken Burcham
> Ken Burcham Consulting, Inc.
> http://www.capemaystation.com
>
>
>