From: Tillmann Schulz <tillmann73@yahoo.de>
To: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Return Codes of BatchUpdateException in PostgreSql 9.6
Date: Tue, 18 Oct 2016 13:14:58 +0000 (UTC)
Message-ID: <2090140889.4873532.1476796498454@mail.yahoo.com> (raw)
References: <2090140889.4873532.1476796498454.ref@mail.yahoo.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Hi,
After debugging my problem with the updateCount in the 9.4.1211 JDBC Driver I found the line in the code which causes the error.
It's
org.postgresql.jdbc.BatchResultHandler, Line 138 , JDBC Driver postgresql-9.4.1211
@Override
public void handleError(SQLException newError) {
if (getException() == null) {
Arrays.fill(updateCounts, committedRows, updateCounts.length, Statement.EXECUTE_FAILED); //138 <-- BUG
//...
Before the line "Arrays.fill..." the updateCounts contain the information of the already successfully inserted records [1,1,1,1,1,0,0,0,0,0].
After filling the array with Statement.EXECUTE_FAILED the array contains [-3,-3,-3,-3,-3,-3,-3,-3,-3,-3]
This is a not correct.
The correct result is [1,1,1,1,1] or [1,1,1,1,1,-3]
How to get this bug fixed? Can you rethink your implementation?
Thank you for your help,
Tillmann
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: tillmann73@yahoo.de
Subject: Re: Return Codes of BatchUpdateException in PostgreSql 9.6
In-Reply-To: <2090140889.4873532.1476796498454@mail.yahoo.com>
References: <2090140889.4873532.1476796498454.ref@mail.yahoo.com> <2090140889.4873532.1476796498454@mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox