[Dbix-class] Re: Help with serialized objects -> old dbic

Bill Moseley moseley at hank.org
Sat Aug 18 16:57:51 GMT 2012


I'm not sure I trust that quoted error message below.  I did some more
testing just now and came with a different set of errors.  So, starting
again:

The existing app is using DBIC 0.08123 and the need to share objects with
newer dbic -- and I've tested with 0.08198_01 and 0.08196.

First, I set this in my apps because the DBIC objects are being places in a
session (meaning I'm not explicitly calling the thaw() method in DBIC:

$DBIx::Class::ResultSourceHandle::thaw_schema =3D $schema;

Both versions work fine to freeze/thaw in their own version, but what
breaks is trying to thaw the other versions serialized objects.

When 0.08123 tries to thaw an object frozen with 0.08198_01 I get this:

No STORABLE_thaw defined for objects of class Tii::DB::ResultSet (even
after a "require Tii::DB::ResultSet;") at ../../lib/Storable.pm (autosplit
into ../../lib/auto/Storable/_retrieve.al) line 380


And going the other direction when 0.08198_01 tries to thaw an object from
0.08123 I get:

DBIx::Class::ResultSet::first(): Unable to perform storage-dependent
operations with a detached result source (source '_unnamed_' is not
associated with a schema).


which I thought $DBIx::Class::ResultSourceHandle::thaw_schema would fix.

I feeling a bit stuck.  I really need to be able to have mixed DBIC
versions running at the same time.

Only thing I can think of is to hunt down every place an object is
serialized and thawed and just store an ID and then refetch from the
database on thaw.  Kind of defeats the entire purpose of caching these in
the first place.

Any ideas?



On Fri, Aug 17, 2012 at 5:12 PM, Bill Moseley <moseley at hank.org> wrote:

> I need some ideas how to deal with this issue:
>
> We serialize DBIC objects with Storable and they get shared.  I have a
> situation where I have some machines running current DBIC and some running
> much older DBIC.   But, the objects are not compatible between versions of
> DBIC.
>
> For example, .08123 (yes, two years old) trying to deserialize from
> current DBIC generates:
>
> No STORABLE_thaw defined for objects of class DBIx::Class::Re
> sultSource::Table (even after a "require DBIx::Class::ResultSource::Table=
;")
> at ../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/_
> retrieve.al) line 380
>
>
> And a similar problem going the other direction.
>
> Any ideas how to make current DBIC and such an old version work together
> until we can get all our servers upgraded?
>
>
> --
> Bill Moseley
> moseley at hank.org
>



-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120818/8c2=
d8df6/attachment.htm


More information about the DBIx-Class mailing list