Re: Problem with executeBatch and "A result was returned when none was expected"

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Lew <noone(at)lewscanon(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Problem with executeBatch and "A result was returned when none was expected"
Date: 2011-03-19 08:46:36
Message-ID: AANLkTikb2O676Sv7TEqOB0bNYrrXP-z+4a4J8Aj66X6z@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 19 March 2011 11:49, Lew <noone(at)lewscanon(dot)com> wrote:

> Sean Bowman wrote:
>>
>> Thanks for the quick response.  I'll switch it around to execute() each
>> prepared statement individually, and accumulate the generated ID's [sic].
>
> Why don't you try it batched without the RETURNING clause, and use
> 'getGeneratedKeys()' as the docs suggest?

There *is* no RETURNING clause in the application's original query
(see the code in the OP), that clause is being added by the driver to
implement Statement.RETURN_GENERATED_KEYS.

Merely requesting generated keys shouldn't really make executeBatch()
explode like this - the app is executing bare INSERTs as far as it
knows. We could definitely do better here.

Oliver

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2011-03-19 08:57:00 Re: Problem with executeBatch and "A result was returned when none was expected"
Previous Message Lew 2011-03-18 22:49:46 Re: Problem with executeBatch and "A result was returned when none was expected"