joib wrote:
what happens is that ehcache creates a copy of the cache object and returns a reference to the copy.
Whoa! What method does it use to make a copy! Does it serialize the object and then desrialize it. My that could be a mighty big object graph. Does it use clone() -- hope not since this will throw and exception (the one thrown by Object's impl) for most of my PoJos. Does it use some fancy memory copying? If so that's a shallow copy. How does the copy method know which of the fields of the copied instance are referring to other objects which might also be in the cache? Do those references now refer to objects actually in the cache's LinkeHashMap?
I'm really curious 'cause my little brain can't think it through in a way that works. How does the cache copy objects?