From: Kris Jurka <books@ejurka.com>
To: hans wulf <lotu1@gmx.net>
Cc: pgsql-jdbc@postgresql.org, Sean Bowman <pico303@gmail.com>
Subject: Re: PreparedStatement batch statement impossible
Date: Sat, 2 Apr 2011 04:46:18 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.1104020434160.1216@leary.csoft.net> (raw)
In-Reply-To: <20110302143801.135430@gmx.net>
References: <20110302143801.135430@gmx.net>
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
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: books@ejurka.com, lotu1@gmx.net, pico303@gmail.com
Subject: Re: PreparedStatement batch statement impossible
In-Reply-To: <alpine.BSO.2.00.1104020434160.1216@leary.csoft.net>
References: <20110302143801.135430@gmx.net> <alpine.BSO.2.00.1104020434160.1216@leary.csoft.net>
* 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