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