openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r525583 - in /incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql: DB2Dictionary.java DBDictionary.java SQLExceptions.java
Date Wed, 04 Apr 2007 19:17:12 GMT
Author: pcl
Date: Wed Apr  4 12:17:11 2007
New Revision: 525583

URL: http://svn.apache.org/viewvc?view=rev&rev=525583
Log:
OPENJPA-184: handle the case where dict is null in SQLExceptions by moving the logic into
DB2Dictionary.newStoreException().

Modified:
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java?view=diff&rev=525583&r1=525582&r2=525583
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
Wed Apr  4 12:17:11 2007
@@ -24,6 +24,7 @@
 import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
 import org.apache.openjpa.jdbc.schema.Sequence;
 import org.apache.openjpa.lib.log.Log;
+import org.apache.openjpa.util.OpenJPAException;
 
 /**
  * Dictionary for IBM DB2 database.
@@ -443,10 +444,18 @@
         return buf;
     }
 
-    /** Append exception information from SQLCA to the exsisting 
+    public OpenJPAException newStoreException(String msg, SQLException[] causes,
+        Object failed) {
+        if (causes != null && causes.length > 0)
+            msg = appendExtendedExceptionMsg(msg, causes[0]);
+        return super.newStoreException(msg, causes, failed);
+    }
+
+    /**
+     *  Append exception information from SQLCA to the exsisting
      *  exception meassage
      */
-    public String appendExtendedExceptionMsg(String msg, SQLException sqle){
+    private String appendExtendedExceptionMsg(String msg, SQLException sqle){
        final String GETSQLCA ="getSqlca";
        String exceptionMsg = new String();
        try {

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?view=diff&rev=525583&r1=525582&r2=525583
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Wed Apr  4 12:17:11 2007
@@ -2471,13 +2471,6 @@
         buf.append(post);
     }
     
-    /** Append any database specific exception message to 
-     *  the exsisting exception message
-     */
-     public String appendExtendedExceptionMsg(String msg, SQLException sqle) {
-         return msg; 
-     }
-    
     ///////////
     // DDL SQL
     ///////////

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java?view=diff&rev=525583&r1=525582&r2=525583
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java
Wed Apr  4 12:17:11 2007
@@ -87,7 +87,6 @@
         Object failed, DBDictionary dict) {
         if (msg == null)
             msg = se.getClass().getName();
-        msg = dict.appendExtendedExceptionMsg(msg,se);
         SQLException[] ses = getSQLExceptions(se);
         if (dict == null)
             return new StoreException(msg).setFailedObject(failed).



Mime
View raw message