blue-sky
blue-sky

Reputation: 53876

For ehcache to store and object is implementing serializable required?

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 ?

Upvotes: 2

Views: 4748

Answers (1)

geoand
geoand

Reputation: 64039

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

Upvotes: 4

Related Questions