openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r1149697 - in /openjpa/trunk/openjpa-jdbc/src/main: java/org/apache/openjpa/jdbc/sql/H2Dictionary.java resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml
Date Fri, 22 Jul 2011 19:20:58 GMT
Author: mikedd
Date: Fri Jul 22 19:20:57 2011
New Revision: 1149697

URL: http://svn.apache.org/viewvc?rev=1149697&view=rev
Log:
OPENJPA-2034: Update error codes for H2 database.
Submitted By: Prashant Bhat

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java?rev=1149697&r1=1149696&r2=1149697&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/H2Dictionary.java
Fri Jul 22 19:20:57 2011
@@ -33,6 +33,7 @@ import org.apache.openjpa.jdbc.schema.Pr
 import org.apache.openjpa.jdbc.schema.Table;
 import org.apache.openjpa.jdbc.schema.Unique;
 import org.apache.openjpa.meta.JavaTypes;
+import org.apache.openjpa.util.StoreException;
 
 /**
  * Dictionary for H2 ({@link http://www.h2database.com}).
@@ -65,6 +66,9 @@ public class H2Dictionary extends DBDict
         supportsNullTableForGetPrimaryKeys = true;
         supportsNullTableForGetIndexInfo = true;
 
+        supportsLockingWithOuterJoin = false;
+        supportsLockingWithInnerJoin = false;
+
         reservedWordSet.addAll(Arrays.asList(new String[] {
             "CURRENT_TIMESTAMP", "CURRENT_TIME", "CURRENT_DATE", "CROSS",
             "DISTINCT", "EXCEPT", "EXISTS", "FROM", "FOR", "FALSE", "FULL",
@@ -239,4 +243,14 @@ public class H2Dictionary extends DBDict
         }
         buf.append(")");
     }
+
+    @Override
+    public boolean isFatalException(int subtype, SQLException ex) {
+        int errorCode = ex.getErrorCode();
+        if ((subtype == StoreException.QUERY || subtype == StoreException.LOCK) 
+            && (57014 == errorCode || 50200 == errorCode)) {
+            return false;
+        }
+        return super.isFatalException(subtype, ex);
+    }
 }

Modified: openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml?rev=1149697&r1=1149696&r2=1149697&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml
Fri Jul 22 19:20:57 2011
@@ -101,12 +101,12 @@
 	</dictionary>
 	
 	<dictionary class="org.apache.openjpa.jdbc.sql.H2Dictionary">
-		<lock>HYT00</lock>
-		<referential-integrity>22003,22012,22025,23000,23002,23003</referential-integrity>
-		<object-exists>23001</object-exists>
+		<lock>HYT00,57014</lock>
+		<referential-integrity>22001,22003,22012,22018,22025,23502,23503,23506,23507,23513,23000,23002,23003</referential-integrity>
+		<object-exists>23001,23505</object-exists>
 		<object-not-found>02000</object-not-found>
 		<optimistic></optimistic>
-		<query>90031</query>
+		<query>90031,57014</query>
 	</dictionary>
 	
 	<dictionary class="org.apache.openjpa.jdbc.sql.HSQLDictionary">



Mime
View raw message