]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Backport batch update error message improvements to 7.3 branch
authorBarry Lind <barry@xythos.com>
Fri, 14 Mar 2003 01:23:08 +0000 (01:23 +0000)
committerBarry Lind <barry@xythos.com>
Fri, 14 Mar 2003 01:23:08 +0000 (01:23 +0000)
 Modified Files:
  Tag: REL7_3_STABLE
  jdbc/org/postgresql/errors.properties
  jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
  jdbc/org/postgresql/util/PSQLException.java

src/interfaces/jdbc/org/postgresql/errors.properties
src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
src/interfaces/jdbc/org/postgresql/util/PSQLException.java

index ca649b06c26aa70a2864c96b099be54224bb401a..5e736e53a6b64c0a1fcb017979f1c060b0fd0467 100644 (file)
@@ -67,7 +67,7 @@ postgresql.serial.namelength:Class & Package name length cannot be longer than 6
 postgresql.serial.noclass:No class found for {0}
 postgresql.serial.table:The table for {0} is not in the database. Contact the DBA, as the database is in an inconsistent state.
 postgresql.serial.underscore:Class names may not have _ in them. You supplied {0}.
-postgresql.stat.batch.error:Batch entry {0} {1} was aborted.
+postgresql.stat.batch.error:Batch entry {0} {1} was aborted. Call getNextException() to see the cause.
 postgresql.stat.maxfieldsize:An attempt to setMaxFieldSize() failed - compile time default in force.
 postgresql.stat.noresult:No results were returned by the query.
 postgresql.stream.eof:The backend has broken the connection. Possibly the action you have attempted has caused it to close.
index 3067ac583854c634c2a4b4607ae1d08336cab3ce..6a8a316bd2f7f45bc0bb134c18f8aa85f5ec5eb3 100644 (file)
@@ -8,7 +8,7 @@ import java.util.Vector;
 import org.postgresql.largeobject.*;
 import org.postgresql.util.PSQLException;
 
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2Statement.java,v 1.8.2.2 2002/11/20 20:42:24 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2Statement.java,v 1.8.2.3 2003/03/14 01:23:08 barry Exp $
  * This class defines methods of the jdbc2 specification.  This class extends
  * org.postgresql.jdbc1.AbstractJdbc1Statement which provides the jdbc1
  * methods.  The real Statement class (for jdbc2) is org.postgresql.jdbc2.Jdbc2Statement
@@ -104,7 +104,7 @@ public abstract class AbstractJdbc2Statement extends org.postgresql.jdbc1.Abstra
 
                        PBatchUpdateException updex =
                                new PBatchUpdateException("postgresql.stat.batch.error",
-                                                                                 new Integer(i), batch.elementAt(i), resultSucceeded);
+                                                                                 new Integer(i), m_sqlFragments[0], resultSucceeded);
                        updex.setNextException(e);
 
                        throw updex;
index 309306bb26a856eedb02ae58debf46b56bdb3644..8dfd38e3a9aebb345dfb6bdcbf2f91a5ed352cb3 100644 (file)
@@ -2,6 +2,7 @@ package org.postgresql.util;
 
 import java.io.*;
 import java.sql.*;
+import org.postgresql.Driver;
 
 /*
  * This class extends SQLException, and provides our internationalisation handling
@@ -18,6 +19,8 @@ public class PSQLException extends SQLException
        {
                super();
                translate(error, null);
+               if (Driver.logDebug)
+                       Driver.debug("Exception: " + this);
        }
 
        /*
@@ -29,6 +32,8 @@ public class PSQLException extends SQLException
        {
                //super();
                translate(error, args);
+               if (Driver.logDebug)
+                       Driver.debug("Exception: " + this);
        }
 
        /*
@@ -40,6 +45,8 @@ public class PSQLException extends SQLException
                Object[] argv = new Object[1];
                argv[0] = arg;
                translate(error, argv);
+               if (Driver.logDebug)
+                       Driver.debug("Exception: " + this);
        }
 
        /*
@@ -71,6 +78,8 @@ public class PSQLException extends SQLException
                }
 
                translate(error, argv);
+               if (Driver.logDebug)
+                       Driver.debug("Exception: " + this);
        }
 
        /*
@@ -83,6 +92,8 @@ public class PSQLException extends SQLException
                argv[0] = arg1;
                argv[1] = arg2;
                translate(error, argv);
+               if (Driver.logDebug)
+                       Driver.debug("Exception: " + this);
        }
 
        private void translate(String error, Object[] args)