Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6FC589FB253 for ; Mon, 15 Jan 2007 08:24:24 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 52176-06 for ; Mon, 15 Jan 2007 08:24:14 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 966779FB22F for ; Mon, 15 Jan 2007 08:24:14 -0400 (AST) Received: (qmail 14455 invoked from network); 15 Jan 2007 12:24:12 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.14?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 15 Jan 2007 12:24:12 -0000 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <55C00BEC-5B33-4358-875E-51A34D217071@fastcrypt.com> Cc: pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: executeBatch() and operation after error Date: Mon, 15 Jan 2007 07:24:31 -0500 To: Heiko W.Rupp X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/95 X-Sequence-Number: 16460 On 15-Jan-07, at 6:13 AM, Heiko W.Rupp wrote: > Hi, > > JDBC 3.0 spec speifies that in 15.1.3 a driver may continue > processing statements in a batch > if one of the statements throws an error. > > Is this supported by the current driver? If yes, how can I enable > this? A cursory examination of the code suggests not. > > I have a use case where most of the time my application would very > much benefit from > using batches, but where sometimes the data to be inserted is > already there. > > Of course there is the workaround to check for a BatchException and > then doing a > getUpdateCounts() to fall back inserting everyhing 'by hand'. But > obviously it is desirable > for e.g. a batch of 10 to only process statement #2 if this is > failing and having all other > statements be treated by the batching Given the semantics of postgresql transactions this would be onerous to implement. If a single statement fails in a transaction subsequent statements fail. Dave > > Heiko > > > -- > Heiko W.Rupp > heiko.rupp@redhat.com, http://www.dpunkt.de/buch/3-89864-429-4.html > > > > > ---------------------------(end of > broadcast)--------------------------- > TIP 7: You can help support the PostgreSQL project by donating at > > http://www.postgresql.org/about/donate >