Hi Azeez,

On Fri, Jul 5, 2013 at 6:17 AM, Afkham Azeez <[email protected]> wrote:

> I may be stating the obvious, but please make sure that all the cache keys
> & values you use are serializable. In addition to the key or value
> implementing the Serializable interface, all the classes of the
> non-transient attributes too should be serializable, all non-transient
> attributes of those attributes should be serializable and so on.
>
> In the case of keys, you should also override equals & hashCode.
>
> If the keys or values are not serializable, they cannot be replicated
> across the cluster.
>
> Please note that you are not limited to using String values for the cache
> key, and hence if you have a number of attributes, instead of combining
> them into a String, please define a serializable POJO.
>

Noted. This is what we used in the registry kernel as the cache key [1].

[1]
https://svn.wso2.org/repos/wso2/carbon/kernel/trunk/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/caching/RegistryCacheKey.java

Thanks
Ajith.

>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * <http://www.apache.org/>**
> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
> blog: **http://blog.afkham.org* <http://blog.afkham.org/>*
> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
> *
> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>



-- 
Ajith Vitharana.
WSO2 Inc. - http://wso2.org
Email  :  [email protected]
Mobile : +94772217350
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to