incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1222005 - /incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
Date Thu, 22 Dec 2011 02:35:13 GMT
Author: kwright
Date: Thu Dec 22 02:35:13 2011
New Revision: 1222005

URL: http://svn.apache.org/viewvc?rev=1222005&view=rev
Log:
Catch duplicate key errors and reinterpret them too

Modified:
    incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java

Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java?rev=1222005&r1=1222004&r2=1222005&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
(original)
+++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceMySQL.java
Thu Dec 22 02:35:13 2011
@@ -68,6 +68,9 @@ public class DBInterfaceMySQL extends Da
     java.sql.SQLException sqlException = (java.sql.SQLException)e;
     String message = sqlException.getMessage();
     String sqlState = sqlException.getSQLState();
+    // Constraint violation
+    if (sqlException instanceof com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException)
+      return new ManifoldCFException(message,e,ManifoldCFException.DATABASE_TRANSACTION_ABORT);
     // Could not serialize
     if (sqlState != null && sqlState.equals("40001"))
       return new ManifoldCFException(message,e,ManifoldCFException.DATABASE_TRANSACTION_ABORT);



Mime
View raw message