cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Jarrel <>
Subject Exception when caching a SelectQuery with prefetching [WAS: Caching]
Date Thu, 20 May 2010 04:22:21 GMT
I managed to get the cache issue described below resolved, my error
with the DataContextFilter that I was using and it was overwriting the
modeler configuration when initializing shared config.

I've ran into another issue with the following code:

SelectQuery q = proto.queryWithParameters(params);

Upon execution of this query I get the following exception:

ERROR com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
[oscache] Exception persisting RichProduct/subCategory =
<ObjectId:SubCategory, category_id=1,
Unable to write
in the cache. Exception:, Message:

<rest of stack trace removed>

If I however remove the prefetches then the caching works fine.

Looking at the source code for ListWithPrefetches it does not
implement Serializable, could this be the reason for it, or am I
missing something!

Thank you


On Wed, May 19, 2010 at 6:17 PM, 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

View raw message