I have a feel it could be in serialization code. I wonder when you put entity into secondary cache I assume you extract its state and thus it can be stored by reference not by value. I wonder if going through JCache API to initialize caches it may by default create by value cache causing unnecessary serialization/deserialization of keys and values all the time. I could not find a declarative way for ehcache to force by-reference model and their docs say that their heap default is by reference but when going through JCache interfaces it defaults to by-value unless set to by-reference during cache initialization. Maybe it is what's happening? |