[libpostgresql-jdbc-java] 07/09: Initialize BatchUpdateExceptions with the SQLState of the SQLException that they are wrapping. Code that inspects the SQLStates of SQLExceptions, but doesn't unwrap the nested exception will not understand the underlying cause and may make incorrect decisions about the severity of the error.

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:20:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to tag REL8_3_605
in repository libpostgresql-jdbc-java.

commit 7f5b82b68096a052a563738cb066036fb4d278c9
Author: Kris Jurka <books at ejurka.com>
Date:   Wed May 27 23:55:27 2009 +0000

    Initialize BatchUpdateExceptions with the SQLState of the
    SQLException that they are wrapping.  Code that inspects the
    SQLStates of SQLExceptions, but doesn't unwrap the nested exception
    will not understand the underlying cause and may make incorrect
    decisions about the severity of the error.
    
    Fujii Masao
---
 org/postgresql/jdbc2/AbstractJdbc2Statement.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/org/postgresql/jdbc2/AbstractJdbc2Statement.java b/org/postgresql/jdbc2/AbstractJdbc2Statement.java
index f59a820..c0e021a 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2Statement.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2Statement.java
@@ -3,7 +3,7 @@
 * Copyright (c) 2004-2008, PostgreSQL Global Development Group
 *
 * IDENTIFICATION
-*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.107 2008/01/15 03:29:15 jurka Exp $
+*   $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.107.2.1 2008/04/02 17:06:04 jurka Exp $
 *
 *-------------------------------------------------------------------------
 */
@@ -2531,6 +2531,7 @@ public abstract class AbstractJdbc2Statement implements BaseStatement
                 batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted.  Call getNextException to see the cause.",
                                  new Object[]{ new Integer(resultIndex),
                                                queryString}),
+                                 newError.getSQLState(),
                                  successCounts);
             }
 
@@ -2596,6 +2597,7 @@ public abstract class AbstractJdbc2Statement implements BaseStatement
                 batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted.  Call getNextException to see the cause.",
                                  new Object[]{ new Integer(resultIndex),
                                                queryString}),
+                                 newError.getSQLState(),
                                  successCounts);
             }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git



More information about the pkg-java-commits mailing list