Grokbase Groups Cayenne user May 2010
FAQ
Hi Guys,

I seem to full of questions today!

In the modeler I've got org.apache.cayenne.cache.OSQueryCacheFactory for
Query Cache Factory, 5000 objects and using shared cache.

I can see OSCache initializing in the logs and everything appears to be
fine.

However when I try to get the cache from the ObjectContext like so:

QueryCache cache = ((BaseContext) getObjectContext()).getQueryCache();

The cache that is being returned is
the org.apache.cayenne.cache.MapQueryCache

I've traced the calls and can see that the call got getQueryCache() goes
to MapQueryCacheFactory despite the fact that the modeler
specifies OSQueryCacheFactory

Am I doing something wrong here?

Thank you

Gary

Search Discussions

  • Andrus Adamchik at May 20, 2010 at 8:10 am
    What type of ObjectContext is this? The behavior you are seeing may
    happen in ROP, but a DataContext on the other hand should always grab
    the cache instance from the parent DataDomain:

    @Override
    public QueryCache getQueryCache() {
    if (queryCache == null) {
    synchronized (this) {
    if (queryCache == null) {

    DataDomain domain = getParentDataDomain();
    queryCache =
    domain.getQueryCacheFactory().getQueryCache(
    domain.getProperties());
    }
    }
    }

    return queryCache;
    }

    Andrus

    On May 19, 2010, at 11:17 AM, Gary Jarrel wrote:

    Hi Guys,

    I seem to full of questions today!

    In the modeler I've got org.apache.cayenne.cache.OSQueryCacheFactory
    for
    Query Cache Factory, 5000 objects and using shared cache.

    I can see OSCache initializing in the logs and everything appears to
    be
    fine.

    However when I try to get the cache from the ObjectContext like so:

    QueryCache cache = ((BaseContext) getObjectContext()).getQueryCache();

    The cache that is being returned is
    the org.apache.cayenne.cache.MapQueryCache

    I've traced the calls and can see that the call got getQueryCache()
    goes
    to MapQueryCacheFactory despite the fact that the modeler
    specifies OSQueryCacheFactory

    Am I doing something wrong here?

    Thank you

    Gary
  • Andrus Adamchik at May 20, 2010 at 8:11 am
    Ah sorry... noticed your other email. Never mind.
    On May 20, 2010, at 11:09 AM, Andrus Adamchik wrote:

    What type of ObjectContext is this? The behavior you are seeing may
    happen in ROP, but a DataContext on the other hand should always
    grab the cache instance from the parent DataDomain:

    @Override
    public QueryCache getQueryCache() {
    if (queryCache == null) {
    synchronized (this) {
    if (queryCache == null) {

    DataDomain domain = getParentDataDomain();
    queryCache =
    domain.getQueryCacheFactory().getQueryCache(
    domain.getProperties());
    }
    }
    }

    return queryCache;
    }

    Andrus

    On May 19, 2010, at 11:17 AM, Gary Jarrel wrote:

    Hi Guys,

    I seem to full of questions today!

    In the modeler I've got
    org.apache.cayenne.cache.OSQueryCacheFactory for
    Query Cache Factory, 5000 objects and using shared cache.

    I can see OSCache initializing in the logs and everything appears
    to be
    fine.

    However when I try to get the cache from the ObjectContext like so:

    QueryCache cache = ((BaseContext)
    getObjectContext()).getQueryCache();

    The cache that is being returned is
    the org.apache.cayenne.cache.MapQueryCache

    I've traced the calls and can see that the call got getQueryCache()
    goes
    to MapQueryCacheFactory despite the fact that the modeler
    specifies OSQueryCacheFactory

    Am I doing something wrong here?

    Thank you

    Gary

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedMay 19, '10 at 8:18a
activeMay 20, '10 at 8:11a
posts3
users2
websitecayenne.apache.org

2 users in discussion

Andrus Adamchik: 2 posts Gary Jarrel: 1 post

People

Translate

site design / logo © 2022 Grokbase