Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id AD6A0133798E for ; Sat, 2 Apr 2011 05:46:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 03374-04 for ; Sat, 2 Apr 2011 08:46:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by mail.postgresql.org (Postfix) with ESMTP id 48DFB13364DE for ; Sat, 2 Apr 2011 05:46:19 -0300 (ADT) Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 09F0F28448; Sat, 2 Apr 2011 04:46:19 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id C2256A3E4; Sat, 2 Apr 2011 04:46:18 -0400 (EDT) Date: Sat, 2 Apr 2011 04:46:18 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: hans wulf cc: pgsql-jdbc@postgresql.org, Sean Bowman Subject: Re: PreparedStatement batch statement impossible In-Reply-To: <20110302143801.135430@gmx.net> Message-ID: References: <20110302143801.135430@gmx.net> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/10 X-Sequence-Number: 21736 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