From: Jeremy Whiting <jwhiting@redhat.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Return Codes of BatchUpdateException in PostgreSql 9.6
Date: Thu, 13 Oct 2016 15:49:28 +0100
Message-ID: <690688e2-6a85-bbe9-c8f4-0c221256747f@redhat.com> (raw)
In-Reply-To: <1148283253.9934888.1476365049022@mail.yahoo.com>
References: <614642043.9384313.1476347124138.ref@mail.yahoo.com>
<614642043.9384313.1476347124138@mail.yahoo.com>
<1476361957.3513.1.camel@gmail.com>
<1148283253.9934888.1476365049022@mail.yahoo.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Hi,
Can you check what is returned by the back end for 9.5 and 9.6. You
will need to set
logLevel=2
That will help to narrow down the problem.
Jeremy
On 13/10/16 14:24, Tillmann Schulz wrote:
> The docu says:
> If the driver continues processing after a failure (and this is the case in my example), BatchUpdateException.getUpdateCounts will have an element for every command.
>
> In my case there is an element for every command but all elements contain -3 (Statement.Execute_Failed) in postgres 9.6.
>
> I think only the failed statmements should been marked with -3! This behaviour is new in 9.6 and seems to be a bug.
>
>
> Thanks
>
> Tillmann
>
>
>> According to the doco, getUpdateCounts():-
>>
>> Returns:
>> an array of int containing the update counts for the updates that
>> were executed successfully before this error occurred. Or, if the
>> driver continues to process commands after an error, one of the
>> following for every command in the batch:
>>
>> 1. an update count
>> 2. Statement.SUCCESS_NO_INFO to indicate that the command executed
>> successfully but the number of rows affected is unknown
>> 3. Statement.EXECUTE_FAILED to indicate that the command failed to
>> execute successfully
>>
>>
>> I do not know if the Postgres "driver continues to process commands
>> after an error" but if it does then the array should contain 10 entries
>> and one would have the "Statement.EXECUTE_FAILED".
>>
>> Tomorrow, I'll dig a bit deeper if nobody else can explain this.
>>
>> HTH,
>> Rob
>
--
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: jwhiting@redhat.com
Subject: Re: Return Codes of BatchUpdateException in PostgreSql 9.6
In-Reply-To: <690688e2-6a85-bbe9-c8f4-0c221256747f@redhat.com>
References: <614642043.9384313.1476347124138.ref@mail.yahoo.com> <614642043.9384313.1476347124138@mail.yahoo.com> <1476361957.3513.1.camel@gmail.com> <1148283253.9934888.1476365049022@mail.yahoo.com> <690688e2-6a85-bbe9-c8f4-0c221256747f@redhat.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