views:

332

answers:

2

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.

+1  A: 

I'm guessing (just guessing) that the answer is "no". However, do take a look at the PortableObject interface. This is supposed to be an alternative to java.io.Serializable, but for performance reasons. You should check whether it can be used to replace Serializable interface.

PortableObject JavaDoc

omerkudat
+2  A: 

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.

David G
Hi, the tangosol docs you linked state that POF starts with Coherence 3.2, and not 3.4.
Miguel Ping
You're right. POF was introduced in 3.2. I fixed my answer. I've only worked with 3.4 and 3.5.
David G