views:

70

answers:

1

EHCache allows for persistance of the cache, and it requires all objects that are being cached to be Serializable. The objects that are being serialized and written to the Disk are being written with ObjectOutputStream, which is fixed in its required fields and UID. link text

My question is: Is there a way to force the serialization [i.e. overwritting writeObject] to force an non-fixed/versioned way? [i.e. protocol buffers, xml, etc]

+1  A: 

ObjectOutputStream, which is fixed in its required fields and UID.

No it isn't. It requires a fixed serialVersionUID all right, but it has a lot of flexibility about how much versioning it can support - see the Versioning chapter of the Object Serialization Specification.

EJP
Will do. I'm also going to update the content of the question.
monksy
OK next question is why do you care about how objects are persisted in the cache? especially now you know you can version, within limits.
EJP
I want some objects to stay arround for a long time, but still have an expirey attribute.
monksy