From bf16127d1973594fdc5c1868521cf14228656527 Mon Sep 17 00:00:00 2001 From: Pinaki Poddar Date: Thu, 26 Feb 2009 13:04:01 +0000 Subject: [PATCH] OPENJPA-924: Only cache finder queries without read locks git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@748126 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java index e9cd0905b..8afc463ad 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java @@ -110,6 +110,8 @@ public class FinderCacheImpl */ public FinderQuery get(ClassMapping mapping, FetchConfiguration fetch) { + if (fetch.getReadLockLevel() != 0) + return null; boolean ignore = isHinted(fetch, QueryHints.HINT_IGNORE_FINDER); boolean invalidate = isHinted(fetch, QueryHints.HINT_INVALIDATE_FINDER); if (invalidate) @@ -143,6 +145,8 @@ public class FinderCacheImpl (ClassMapping mapping, SelectExecutor select, FetchConfiguration fetch) { lock(); try { + if (fetch.getReadLockLevel() != 0) + return null; boolean recache = isHinted(fetch, QueryHints.HINT_RECACHE_FINDER); if (isExcluded(mapping)) { return recache ? put(mapping, select) : null;