Search code examples
javacachingoracle-coherence

Can Tangosol Coherence cache non-serializable objects?


I'm using Tangosol Coherence v3.2.2b371. Can I cache objects that do not implement Serializable through the NamedCache api? Or this depends on configuration?


Edit: For clarification, I'm trying to cache compiled javax.xml.xpath.XPathExpression objects.


Solution

  • To store an object in the cache it must be serializable but does not have to implement Serializable. Specifically, it can use POF which is more efficient in time and memory than Serializable.

    POF does require some additional configuration, which is described in the article I linked to.