Re: JDBC gripe list

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Quartz <quartz12h(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC gripe list
Date: 2011-03-29 20:17:29
Message-ID: AANLkTin_Ju-qA3aNrTt42jgA_piaz4SDSBjcCC4pRYuB@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, Mar 29, 2011 at 3:29 PM, Quartz <quartz12h(at)yahoo(dot)com> wrote:
> addBatch()/executeBatch() is broken under autocommit=true.
>
> Every statement is clearly supposed to be independant.
> Example: 5 insert statements, let's say the 2th and the 4th are on duplicate of primary key. All 3 others should still be performed but they aren't.
>
> This breaks our application. We migrated from mysql, and BOOM...
>

I would think the concept of execute batch would infer that they
should all commit or none should. This line from the API seems to
infer that

"Submits a batch of commands to the database for execution and if all
commands execute successfully, returns an array of update counts."

Where it states "if all commands execute successfully" implies a
transaction in the postgresql world.

Dave

>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Quartz 2011-03-29 20:34:31 Re: JDBC gripe list
Previous Message Quartz 2011-03-29 20:03:51 Re: JDBC gripe list