UtilCache create with a disk store

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

UtilCache create with a disk store

Adam Heath-2
When a UtilCache instance is created with a backing store, should it
reuse an existing disk store, or should it create a new one?  The
problem as I see it is that any previously serialized data might not
deserialize properly.  While it's possible to support differing
classes during deserialization, doing so greatly complicates each
serializable instance.

It's been my experience that classes that implement Serializable don't
fully do it correctly; they don't handle deserializable from older
versions of themselves.

So, I think that the disk store for a UtilCache instance should be
cleared when it is created.
Reply | Threaded
Open this post in threaded view
|

Re: UtilCache create with a disk store

Adrian Crum-2
--- On Mon, 3/22/10, Adam Heath <[hidden email]> wrote:

> When a UtilCache instance is created
> with a backing store, should it
> reuse an existing disk store, or should it create a new
> one?  The
> problem as I see it is that any previously serialized data
> might not
> deserialize properly.  While it's possible to support
> differing
> classes during deserialization, doing so greatly
> complicates each
> serializable instance.
>
> It's been my experience that classes that implement
> Serializable don't
> fully do it correctly; they don't handle deserializable
> from older
> versions of themselves.
>
> So, I think that the disk store for a UtilCache instance
> should be
> cleared when it is created.

From my perspective, cache disk storage should work the same as memory. When the instance is created, the cache is empty. It doesn't matter if the cache is in memory or on disk.

-Adrian