openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jrba...@apache.org
Subject svn commit: r755116 - in /openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence: PersistenceExceptions.java QueryTimeoutException.java
Date Tue, 17 Mar 2009 04:40:38 GMT
Author: jrbauer
Date: Tue Mar 17 04:40:38 2009
New Revision: 755116

URL: http://svn.apache.org/viewvc?rev=755116&view=rev
Log:
OPENJPA-878 Committing code, tests, and documentation updates for Donald Woods.

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

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java?rev=755116&r1=755115&r2=755116&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java
Tue Mar 17 04:40:38 2009
@@ -28,6 +28,7 @@
 import org.apache.openjpa.util.ObjectNotFoundException;
 import org.apache.openjpa.util.OpenJPAException;
 import org.apache.openjpa.util.OptimisticException;
+import org.apache.openjpa.util.QueryException;
 import org.apache.openjpa.util.RuntimeExceptionTranslator;
 import org.apache.openjpa.util.StoreException;
 import org.apache.openjpa.util.UserException;
@@ -186,6 +187,19 @@
                 e = new org.apache.openjpa.persistence.EntityExistsException
                     (ke.getMessage(), getNestedThrowables(ke),
                         getFailedObject(ke), ke.isFatal());
+        } else if (ke.getSubtype() == StoreException.QUERY
+                || cause instanceof QueryException) {
+            QueryException queryEx = (QueryException)
+                (ke instanceof QueryException ? ke : cause);
+            if (!queryEx.isFatal()) {
+                e = new org.apache.openjpa.persistence.QueryTimeoutException(
+                    ke.getMessage(), getNestedThrowables(ke),
+                    getFailedObject(ke), ke.isFatal());
+            } else {
+                e = new org.apache.openjpa.persistence.PersistenceException(
+                    ke.getMessage(), getNestedThrowables(ke),
+                    getFailedObject(ke), ke.isFatal());
+            }
         } else {
                 e = new org.apache.openjpa.persistence.PersistenceException
                     (ke.getMessage(), getNestedThrowables(ke),

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryTimeoutException.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryTimeoutException.java?rev=755116&r1=755115&r2=755116&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryTimeoutException.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryTimeoutException.java
Tue Mar 17 04:40:38 2009
@@ -30,7 +30,7 @@
 import org.apache.openjpa.util.StoreException;
 
 /**
- * Query lock timeout violation.
+ * Query timeout violation.
  *
  * @since 2.0.0
  * @nojavadoc
@@ -39,6 +39,8 @@
     extends javax.persistence.QueryTimeoutException
     implements Serializable, ExceptionInfo {
 
+    private static final long serialVersionUID = -2154020315916482766L;
+    
     private transient boolean _fatal = false;
     private transient Object _failed = null;
     private transient Throwable[] _nested = null;
@@ -56,7 +58,7 @@
     }
 
     public int getSubtype() {
-        return StoreException.LOCK;
+        return StoreException.QUERY;
     }
 
     public boolean isFatal() {



Mime
View raw message