You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by cu...@apache.org on 2011/06/27 16:01:02 UTC

svn commit: r1140165 - in /openjpa/branches/2.1.x: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java openjpa-project/src/doc/manual/ref_guide_dbsetup.xml

Author: curtisr7
Date: Mon Jun 27 14:01:02 2011
New Revision: 1140165

URL: http://svn.apache.org/viewvc?rev=1140165&view=rev
Log:
OPENJPA-1990: Skip calling back to DB2 when an exception is encountered.

Modified:
    openjpa/branches/2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
    openjpa/branches/2.1.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml

Modified: openjpa/branches/2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java?rev=1140165&r1=1140164&r2=1140165&view=diff
==============================================================================
--- openjpa/branches/2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java (original)
+++ openjpa/branches/2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java Mon Jun 27 14:01:02 2011
@@ -92,6 +92,7 @@ public class DB2Dictionary
     protected int min = 0;
     
     private int defaultBatchLimit = 100;
+    public boolean appendExtendedExceptionText = true;
     
     public DB2Dictionary() {
         platform = "DB2";
@@ -585,10 +586,10 @@ public class DB2Dictionary
         return "";
     }
 
-    public OpenJPAException newStoreException(String msg, SQLException[] causes,
-        Object failed) {
-        if (causes != null && causes.length > 0)
+    public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) {
+        if (appendExtendedExceptionText == true && causes != null && causes.length > 0) {
             msg = appendExtendedExceptionMsg(msg, causes[0]);
+        }
         return super.newStoreException(msg, causes, failed);
     }
 

Modified: openjpa/branches/2.1.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
URL: http://svn.apache.org/viewvc/openjpa/branches/2.1.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml?rev=1140165&r1=1140164&r2=1140165&view=diff
==============================================================================
--- openjpa/branches/2.1.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml (original)
+++ openjpa/branches/2.1.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml Mon Jun 27 14:01:02 2011
@@ -3917,6 +3917,39 @@ the operation will fail.
             </itemizedlist>
         </section>
         
+        <section id="ref_guide_dbsetup_dbsupport_db2">
+            <title>
+                DB2 Properties
+            </title>
+            <indexterm zone="ref_guide_dbsetup_dbsupport_db2">
+                <primary>
+                    DB2
+                </primary>
+                <seealso>
+                    DBDictionary
+                </seealso>
+            </indexterm>
+            <para>
+The <literal>db2</literal> dictionary understands the following additional
+properties:
+            </para>
+            <itemizedlist>
+                <listitem id="DB2Dictionary.AppendExtendedExceptionText">
+                    <para>
+                    <indexterm>
+                        <primary>
+                            DB2
+                        </primary>
+                        <secondary>
+                            AppendExtendedExceptionText
+                        </secondary>
+                    </indexterm>
+<literal>AppendExtendedExceptionText</literal>: If false, OpenJPA will not call back to the database to 
+get extended exception text.
+                    </para>
+                </listitem>
+            </itemizedlist>
+        </section>        
         <section id="ref_guide_dbsetup_dbsupport_delim_id">
         	<title>
         		Delimited Identifiers Support