Re: PreparedStatement batch statement impossible - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: PreparedStatement batch statement impossible
Date
Msg-id alpine.BSO.2.00.1104020434160.1216@leary.csoft.net
Whole thread Raw
In response to PreparedStatement batch statement impossible  ("hans wulf" <lotu1@gmx.net>)
List pgsql-jdbc

On Wed, 2 Mar 2011, hans wulf wrote:

> when using addBatch() and executeBatch() it is impossible to get the
> generated keys. addBatch() fails with an BatchUpdateException because it
> isn't expecting results. I am using postgres 9.0 and the newest 9.0_801
> JDBC-Thingy.
>

I have implemented returning generated keys for batch execution.
Unfortunately, it does have to make a performance compromise to be able to
support returning values.  Since the returned values may be potentially
large, we can't batch up multiple statements for sending to the server
because of the deadlock risk.

Test jar available here:

http://www.ejurka.com/pgsql/jars/batchgenkey/

Kris Jurka

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: JDBC4 Binary Mode with Arrays
Next
From: Radosław Smogura
Date:
Subject: Re: JDBC4 Binary Mode with Arrays