JCache/EhCache implementation maintains a single "physical" cache object per 
Cayenne cache group. It is shared between Cayenne shared cache and each one of 
the per-context local caches. To distinguish the entries from say 2 
ObjectContexts within the cache we use unique key prefixes. When an 
ObjectContext goes away, its cache entries stay in the cache, but become 
effectively inaccessible. They will eventually get removed or replaced with 
other entries by the cache, depending on the cache settings.

Andrus


> On Mar 16, 2017, at 9:24 PM, Lon Varscsak <[email protected]> wrote:
> 
> When using JCache (in my case it’s implementation is EHCache) is an
> ObjectContext’s localCache tied to the object context or is it global?  In
> other words, if I use localCache will the cache go away when the object
> context goes away or does it persist?
> 
> -Lon

Reply via email to