openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r922119 - /openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java
Date Fri, 12 Mar 2010 02:25:52 GMT
Author: ppoddar
Date: Fri Mar 12 02:25:52 2010
New Revision: 922119

URL: http://svn.apache.org/viewvc?rev=922119&view=rev
Log:
OPENJPA-1561: Cache criteria query

Modified:
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=922119&r1=922118&r2=922119&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java
Fri Mar 12 02:25:52 2010
@@ -150,7 +150,8 @@ public class QueryImpl<X> implements Ope
 	}
 
 	public String getQueryString() {
-		return _query.getQueryString();
+		String result = _query.getQueryString();
+		return result != null ? result : _id;
 	}
 
 	public boolean getIgnoreChanges() {
@@ -291,6 +292,8 @@ public class QueryImpl<X> implements Ope
                 postExecute(result);
             }
             return result;
+		} catch (LockTimeoutException e) {
+		    throw new QueryTimeoutException(e.getMessage(), new Throwable[]{e}, getQueryString(),
e.isFatal());
 		} finally {
 		    unlock();
 		}
@@ -528,7 +531,7 @@ public class QueryImpl<X> implements Ope
             }
             stats.recordExecution(pq.getOriginalQuery());
         } else {
-            stats.recordExecution(_query.getQueryString());
+            stats.recordExecution(getQueryString());
         }
         return registered == Boolean.TRUE;
     }



Mime
View raw message