openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r748126 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java
Date Thu, 26 Feb 2009 13:04:02 GMT
Author: ppoddar
Date: Thu Feb 26 13:04:01 2009
New Revision: 748126

URL: http://svn.apache.org/viewvc?rev=748126&view=rev
Log:
OPENJPA-924: Only cache finder queries without read locks

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java?rev=748126&r1=748125&r2=748126&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/FinderCacheImpl.java
Thu Feb 26 13:04:01 2009
@@ -110,6 +110,8 @@
      */
     public FinderQuery<ClassMapping,SelectExecutor,Result> 
         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 @@
        (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;



Mime
View raw message