You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Lon Varscsak <lo...@gmail.com> on 2017/03/16 18:24:12 UTC
JCache/EHCache scope
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
Re: JCache/EHCache scope
Posted by Lon Varscsak <lo...@gmail.com>.
Ah, gotcha. Thanks!
-Lon
On Mon, Mar 20, 2017 at 4:47 AM, Andrus Adamchik <an...@objectstyle.org>
wrote:
> 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 <lo...@gmail.com>
> 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
>
>
Re: JCache/EHCache scope
Posted by Andrus Adamchik <an...@objectstyle.org>.
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 <lo...@gmail.com> 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