pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Enrico Olivelli - Diennea <enrico.olivelli@diennea.com>
To: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Return Codes of BatchUpdateException in PostgreSql 9.6
Date: Wed, 19 Oct 2016 09:24:15 +0000
Message-ID: <1476869053.7453.6.camel@diennea.com> (raw)
In-Reply-To: <2090140889.4873532.1476796498454@mail.yahoo.com>
References: <2090140889.4873532.1476796498454.ref@mail.yahoo.com>
	<2090140889.4873532.1476796498454@mail.yahoo.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

Hi all,
I recently updated my version of the JDBC driver in production.

is it possible to release an hotfix ?

thank you very much

Enrico Olivelli

Il giorno mar, 18/10/2016 alle 13.14 +0000, Tillmann Schulz ha scritto:

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




--

Enrico Olivelli Software Development Manager @Diennea Tel.: (+39) 0546 066100 - Int. 925 Viale G.Marconi 30/14 - 48018 Faenza (RA) MagNews - E-mail Marketing Solutions http://www.magnews.it Diennea - Digital Marketing Solutions http://www.diennea.com

________________________________

Iscriviti alla nostra newsletter per rimanere aggiornato su digital ed email marketing! http://www.magnews.it/newsletter/

The information in this email is confidential and may be legally privileged. If you are not the intended recipient please notify the sender immediately and destroy this email. Any unauthorized, direct or indirect, disclosure, copying, storage, distribution or other use is strictly forbidden.


view thread (19+ messages)  latest in thread

Message-ID: <1476869053.7453.6.camel@diennea.com>
Permalink:  ../1476869053.7453.6.camel@diennea.com/
Also on:    postgresql.org/message-id/1476869053.7453.6.camel@diennea.com

 · 

reply

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: enrico.olivelli@diennea.com
  Subject: Re: Return Codes of BatchUpdateException in PostgreSql 9.6
  In-Reply-To: <1476869053.7453.6.camel@diennea.com>
  References: <2090140889.4873532.1476796498454.ref@mail.yahoo.com> <2090140889.4873532.1476796498454@mail.yahoo.com> <1476869053.7453.6.camel@diennea.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