Pregunta

I've encountered some code that is using Spring ehcache. The objects that are being cached do not implement the serializable interface.

class MyObj(){

}

List<MyObj> = new ArrayList<MyObj>

So even though ArrayList implements serializable should'nt MyObj also implement serializable for ehcache to work correctly ?

¿Fue útil?

Solución

Objects used in Ehcache only need to implement Serializable if you need to store the cache on disk or are using cache replication.

Check out the section

Supports Object or Serializable caching

from this documentation

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top