openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fayw...@apache.org
Subject svn commit: r987289 - in /openjpa/trunk/openjpa-jdbc/src/main: java/org/apache/openjpa/jdbc/sql/SolidDBDictionary.java resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml
Date Thu, 19 Aug 2010 20:09:46 GMT
Author: faywang
Date: Thu Aug 19 20:09:45 2010
New Revision: 987289

URL: http://svn.apache.org/viewvc?rev=987289&view=rev
Log:
OPENJPA-735: OpenJPA support for SolidDB

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SolidDBDictionary.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/SolidDBDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SolidDBDictionary.java?rev=987289&r1=987288&r2=987289&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SolidDBDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SolidDBDictionary.java
Thu Aug 19 20:09:45 2010
@@ -20,6 +20,7 @@ package org.apache.openjpa.jdbc.sql;
 
 import java.math.BigDecimal;
 import java.sql.PreparedStatement;
+import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.text.MessageFormat;
 import java.util.ArrayList;
@@ -31,6 +32,7 @@ import org.apache.openjpa.jdbc.identifie
 import org.apache.openjpa.jdbc.kernel.exps.FilterValue;
 import org.apache.openjpa.jdbc.kernel.exps.Lit;
 import org.apache.openjpa.jdbc.schema.Column;
+import org.apache.openjpa.jdbc.schema.ForeignKey;
 import org.apache.openjpa.jdbc.schema.Index;
 import org.apache.openjpa.jdbc.schema.PrimaryKey;
 import org.apache.openjpa.jdbc.schema.Schema;
@@ -41,6 +43,7 @@ import org.apache.openjpa.jdbc.schema.Un
 import org.apache.openjpa.kernel.exps.Literal;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.meta.JavaTypes;
+import org.apache.openjpa.util.StoreException;
 import org.apache.openjpa.util.UserException;
 
 /**
@@ -524,4 +527,24 @@ public class SolidDBDictionary
             selectSQL.append(")");
         }
     }
+
+    /**
+     * Solid does no support deferred referential integrity checking.
+     */
+    @Override
+    protected ForeignKey newForeignKey(ResultSet fkMeta)
+    throws SQLException {
+        ForeignKey fk = super.newForeignKey(fkMeta);
+        fk.setDeferred(false);
+        return fk;
+    }
+
+    @Override
+    public boolean isFatalException(int subtype, SQLException ex) {
+        String errorState = ex.getSQLState();
+        int errorCode = ex.getErrorCode();
+        if (subtype == StoreException.LOCK && errorCode == 14529 && "HY000".equals(errorState))
+            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=987289&r1=987288&r2=987289&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
Thu Aug 19 20:09:45 2010
@@ -191,7 +191,7 @@
 	</dictionary>
 	
 	<dictionary class="org.apache.openjpa.jdbc.sql.SolidDBDictionary">
-		<lock></lock>
+		<lock>HY000</lock>
 		<referential-integrity></referential-integrity>
 		<object-exists>23000</object-exists>
 		<object-not-found></object-not-found>



Mime
View raw message