문제

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 ?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top