openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Albert Lee <allee8...@gmail.com>
Subject Re: svn commit: r1043572 - in /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa: datacache/QueryCacheStoreQuery.java kernel/AbstractStoreQuery.java kernel/ExpressionStoreQuery.java kernel/StoreQuery.java
Date Thu, 09 Dec 2010 15:23:04 GMT
Should this commit goes to 21x branch too?

Albert Lee.

On Wed, Dec 8, 2010 at 12:20 PM, <faywang@apache.org> wrote:

> Author: faywang
> Date: Wed Dec  8 18:20:21 2010
> New Revision: 1043572
>
> URL: http://svn.apache.org/viewvc?rev=1043572&view=rev
> Log:
> OPENJPA-1810: fix performance regression for non-criteria query cache.
>
> Modified:
>
>  openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java
>
>  openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractStoreQuery.java
>
>  openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java
>
>  openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreQuery.java
>
> Modified:
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java
> URL:
> http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java?rev=1043572&r1=1043571&r2=1043572&view=diff
>
> ==============================================================================
> ---
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java
> (original)
> +++
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java
> Wed Dec  8 18:20:21 2010
> @@ -262,6 +262,10 @@ public class QueryCacheStoreQuery
>         return _query.newCompilation();
>     }
>
> +    public Object getCompilation() {
> +        return _query.getCompilation();
> +    }
> +
>     public void populateFromCompilation(Object comp) {
>         _query.populateFromCompilation(comp);
>     }
> @@ -331,7 +335,7 @@ public class QueryCacheStoreQuery
>         public ResultObjectProvider executeQuery(StoreQuery q, Object[]
> params,
>             Range range) {
>             QueryCacheStoreQuery cq = (QueryCacheStoreQuery) q;
> -            Object parsed = cq.getDelegate().newCompilation();
> +            Object parsed = cq.getDelegate().getCompilation();
>             QueryKey key = QueryKey.newInstance(cq.getContext(),
>                 _ex.isPacking(q), params, _candidate, _subs, range.start,
>                 range.end, parsed);
>
> Modified:
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractStoreQuery.java
> URL:
> http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractStoreQuery.java?rev=1043572&r1=1043571&r2=1043572&view=diff
>
> ==============================================================================
> ---
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractStoreQuery.java
> (original)
> +++
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractStoreQuery.java
> Wed Dec  8 18:20:21 2010
> @@ -72,6 +72,10 @@ public abstract class AbstractStoreQuery
>         return null;
>     }
>
> +    public Object getCompilation() {
> +        return null;
> +    }
> +
>     public void populateFromCompilation(Object comp) {
>     }
>
>
> Modified:
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java
> URL:
> http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java?rev=1043572&r1=1043571&r2=1043572&view=diff
>
> ==============================================================================
> ---
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java
> (original)
> +++
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ExpressionStoreQuery.java
> Wed Dec  8 18:20:21 2010
> @@ -154,6 +154,10 @@ public class ExpressionStoreQuery
>         return _parser.parse(ctx.getQueryString(), this);
>     }
>
> +    public Object getCompilation() {
> +        return _parsed;
> +    }
> +
>     public void populateFromCompilation(Object comp) {
>         _parser.populate(comp, this);
>     }
>
> Modified:
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreQuery.java
> URL:
> http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreQuery.java?rev=1043572&r1=1043571&r2=1043572&view=diff
>
> ==============================================================================
> ---
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreQuery.java
> (original)
> +++
> openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreQuery.java
> Wed Dec  8 18:20:21 2010
> @@ -90,6 +90,11 @@ public interface StoreQuery
>      * Create a new compilation for this query. May be null.
>      */
>     public Object newCompilation();
> +
> +    /**
> +     * Get the current compilation for this query. If it is null, do not
> create.
> +     */
> +    public Object getCompilation();
>
>     /**
>      * Populate internal data from compilation.
>
>
>


-- 
Albert Lee.

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