openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <michael.d.d...@gmail.com>
Subject Re: Is setQueryCache() broken, and how to fix?
Date Tue, 03 Mar 2009 03:02:37 GMT
Hi Joe,

I'd say this is a bug.

OpenJPAQuery q = OpenJPAPersistence.cast(em.createQuery("Select p from
Person p");
q.setQueryCacheEnabled(false);  // should behave identically to disabling
the query cache in the config.

I'm not terribly familiar with that part of the code, but if you're
interested in pursuing the problem I'll try to help.

-mike


On Mon, Mar 2, 2009 at 11:54 AM, Joseph Weinstein
<joe.weinstein@oracle.com>wrote:

> Hi all, I am starting my climb to being able to fix OpenJPA bugs,
> and would like anyone's opinion on a case I want to fix or at least
> explain.
>  My current problem involves a case where the application code wants
> no query cache, and causes setQueryCache(false) to be called, reaching
> class
>
> org.apache.openjpa.jdbc.kernel.JDBCFetchConfigurationImpl
>
> Note that QueryCache is set to true in the properties file. Then the
> code executes a query, and during the query, and during it's processing
> I nevertheless see caching:
>
>     [java]     at
> org.apache.openjpa.datacache.ConcurrentQueryCache.putInternal(ConcurrentQueryCache.java:124)
>     [java]     at
> org.apache.openjpa.datacache.AbstractQueryCache.put(AbstractQueryCache.java:115)
>     [java]     at
> org.apache.openjpa.datacache.DelegatingQueryCache.put(DelegatingQueryCache.java:124)
>     [java]     at
> org.apache.openjpa.datacache.QueryCacheStoreQuery$CachingResultObjectProvider.checkFinished(QueryCacheStoreQuery.java:561)
>     [java]     at
> org.apache.openjpa.datacache.QueryCacheStoreQuery$CachingResultObjectProvider.next(QueryCacheStoreQuery.java:593)
>     [java]     at
> org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:35)
>     [java]     at
> org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1219)
>     [java]     at
> org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:987)
>     [java]     at
> org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796)
>     [java]     at
> org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:766)
> ...
>
> If I totally turn off caching in the config, we use a
> org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider
> being used, not a QueryCacheStoreQuery...
>
> So how should the no-cache state in JDBCFetchConfigurationImpl
> have reached/affected the query processing?
>
> thanks in advance for your expertise,
> Joe Weinstein at Oracle
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message