openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dez...@apache.org
Subject svn commit: r802203 - in /openjpa/branches/1.1.x: openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestQueryResultSize.java
Date Fri, 07 Aug 2009 21:26:02 GMT
Author: dezzio
Date: Fri Aug  7 21:26:02 2009
New Revision: 802203

URL: http://svn.apache.org/viewvc?rev=802203&view=rev
Log:
OpenJPA-1006: merged fix from trunk rev 765801: "Disabling QueryCaching at runtime does not
work"

Added:
    openjpa/branches/1.1.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestQueryResultSize.java
      - copied unchanged from r765801, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/datacache/TestQueryResultSize.java
Modified:
    openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java
  (contents, props changed)

Modified: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java?rev=802203&r1=802202&r2=802203&view=diff
==============================================================================
--- openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java
(original)
+++ openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java
Fri Aug  7 21:26:02 2009
@@ -261,7 +261,8 @@
 
     public Executor newDataStoreExecutor(ClassMetaData meta, boolean subs) {
         Executor ex = _query.newDataStoreExecutor(meta, subs);
-        return new QueryCacheExecutor(ex, meta, subs);
+        return new QueryCacheExecutor(ex, meta, subs,
+                      getContext().getFetchConfiguration());
     }
 
     public boolean supportsAbstractExecutors() {
@@ -289,12 +290,14 @@
         private final Executor _ex;
         private final Class _candidate;
         private final boolean _subs;
+        private final FetchConfiguration _fc;
 
         public QueryCacheExecutor(Executor ex, ClassMetaData meta,
-            boolean subs) {
+            boolean subs, FetchConfiguration fc) {
             _ex = ex;
             _candidate = (meta == null) ? null : meta.getDescribedType();
             _subs = subs;
+            _fc = fc;
         }
 
         public ResultObjectProvider executeQuery(StoreQuery q, Object[] params,
@@ -309,7 +312,10 @@
 
             ResultObjectProvider rop = _ex.executeQuery(cq.getDelegate(),
                 params, range);
-            return cq.wrapResult(rop, key);
+            if (_fc.getQueryCacheEnabled())
+                return cq.wrapResult(rop, key);
+            else
+                return rop;
         }
 
         /**
@@ -653,8 +659,8 @@
         public final Object oid;
 
         public CachedObjectId (Object oid)
-		{
-			this.oid = oid;
-		}
-	}
+        {
+            this.oid = oid;
+        }
+    }
 }

Propchange: openjpa/branches/1.1.x/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Aug  7 21:26:02 2009
@@ -0,0 +1 @@
+/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/QueryCacheStoreQuery.java:765801,800563



Mime
View raw message