openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r931634 - /openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
Date Wed, 07 Apr 2010 18:21:10 GMT
Author: allee8285
Date: Wed Apr  7 18:21:10 2010
New Revision: 931634

URL: http://svn.apache.org/viewvc?rev=931634&view=rev
Log:
OPENJPA-1609 - Commit contribution by Jody Grassel.

Modified:
    openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java

Modified: openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java?rev=931634&r1=931633&r2=931634&view=diff
==============================================================================
--- openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
(original)
+++ openjpa/branches/2.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
Wed Apr  7 18:21:10 2010
@@ -929,8 +929,18 @@ public class DB2Dictionary
         int errorCode = ex.getErrorCode();
         if (errorCode == -952 && "57014".equals(errorState))
             return false;
+        /*
+         * Check if this Exception was generated by a lock timeout expiration.
+         * The following criteria are used to determine this:
+         * 
+         * DB2 LUW Infocenter: SQLSTATE=57033 with reason code "80" indicates
+         * the statement failed due to timeout. DB2 for z/OS Stored Procedures:
+         * Through the CALL and Beyond, page 188: An ErrorCode of -913 with
+         * SQLERR 00C9008E means a timeout has occurred.
+         */
         if (subtype == StoreException.LOCK && "57033".equals(errorState)
-            && ex.getMessage().indexOf("80") != -1) {
+            && ((ex.getMessage().indexOf("80") != -1) 
+                || (errorCode == -913 && ex.getMessage().contains("00C9008E"))))
{
             return false;
         } 
         if ((subtype == StoreException.QUERY && "57014".equals(errorState) &&



Mime
View raw message