You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by jo...@apache.org on 2019/07/09 14:33:12 UTC

[cayenne] branch master updated: Revert "CAY-2589 Allow optionally using a local query cache that is separate from the shared query cache."

This is an automated email from the ASF dual-hosted git repository.

johnthuss pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git


The following commit(s) were added to refs/heads/master by this push:
     new e60ce41  Revert "CAY-2589 Allow optionally using a local query cache that is separate from the shared query cache."
e60ce41 is described below

commit e60ce41fbe0b5bce0c6132dc25d3c5eda2516fb7
Author: John Huss <jo...@apache.org>
AuthorDate: Tue Jul 9 09:31:03 2019 -0500

    Revert "CAY-2589 Allow optionally using a local query cache that is separate from the shared query cache."
    
    This reverts commit 597376ae558b9a0c5ddc4390da188b9530204e3d.
---
 RELEASE-NOTES.txt                                  |  1 -
 .../main/java/org/apache/cayenne/BaseContext.java  | 27 +---------------------
 .../cayenne/util/ObjectContextQueryAction.java     |  9 +-------
 3 files changed, 2 insertions(+), 35 deletions(-)

diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 2c34fda..08e2b34 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -38,7 +38,6 @@ CAY-2569 Custom 'Naming Strategy' in Cayenne Modeler
 CAY-2570 Use MySQL adapter for latest versions of MariaDB
 CAY-2579 Review and possibly relax usage of readonly flag of ObjRelationship
 CAY-2585 Rename scalarQuery and params methods in SQLSelect
-CAY-2589 - Allow optionally using a local query cache that is separate from the shared query cache.
 CAY-2590 Add method to set query timeout to queries
 CAY-2592 Modeler: make all datamaps selected in global cgen tab
 
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/BaseContext.java b/cayenne-server/src/main/java/org/apache/cayenne/BaseContext.java
index ffae953..981db73 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/BaseContext.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/BaseContext.java
@@ -98,7 +98,6 @@ public abstract class BaseContext implements ObjectContext {
 	// registry
 	protected transient DataChannel channel;
 	protected transient QueryCache queryCache;
-	protected transient QueryCache localQueryCache;
 	protected transient EntityResolver entityResolver;
 
 	protected boolean validatingObjectsOnCommit = true;
@@ -470,41 +469,17 @@ public abstract class BaseContext implements ObjectContext {
 	@Override
 	public abstract Collection<?> uncommittedObjects();
 
-	/**
-	 * Used for storing cached query results available to all ObjectContexts.
-	 */
 	public QueryCache getQueryCache() {
 		attachToRuntimeIfNeeded();
 		return queryCache;
 	}
 
 	/**
-	 * Sets a QueryCache to be used for storing cached query results available to all ObjectContexts.
+	 * Sets a QueryCache to be used for storing cached query results.
 	 */
 	public void setQueryCache(QueryCache queryCache) {
 		this.queryCache = queryCache;
 	}
-	
-	/**
-	 * Used for storing cached query results available only to this ObjectContext.
-	 * By default the local query cache and the shared query cache will use the same underlying storage.
-	 * 
-	 * @since 4.2
-	 */
-	public QueryCache getLocalQueryCache() {
-		attachToRuntimeIfNeeded();
-		return localQueryCache != null ? localQueryCache : getQueryCache();
-	}
-
-	/**
-	 * Sets a QueryCache to be used for storing cached query results available only to this ObjectContext.
-	 * By default the local query cache and the shared query cache will use the same underlying storage.
-	 * 
-	 * @since 4.2
-	 */
-	public void setLocalQueryCache(QueryCache queryCache) {
-		this.localQueryCache = queryCache;
-	}
 
 	/**
 	 * Returns EventManager associated with the ObjectStore.
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/util/ObjectContextQueryAction.java b/cayenne-server/src/main/java/org/apache/cayenne/util/ObjectContextQueryAction.java
index acef54e..75dbdfa 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/util/ObjectContextQueryAction.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/util/ObjectContextQueryAction.java
@@ -360,7 +360,7 @@ public abstract class ObjectContextQueryAction {
             return !DONE;
         }
 
-        QueryCache queryCache = getLocalQueryCache();
+        QueryCache queryCache = getQueryCache();
         QueryCacheEntryFactory factory = getCacheObjectFactory();
 
         if (cache) {
@@ -385,13 +385,6 @@ public abstract class ObjectContextQueryAction {
     protected QueryCache getQueryCache() {
         return ((BaseContext) actingContext).getQueryCache();
     }
-    
-    /**
-     * @since 4.2
-     */
-    protected QueryCache getLocalQueryCache() {
-        return ((BaseContext) actingContext).getLocalQueryCache();
-    }
 
     /**
      * @since 3.0