X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id CA48E11F6B14 for ; Sun, 2 Apr 2006 09:55:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 66494-10 for ; Sun, 2 Apr 2006 09:55:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id C4B3211F6AA1 for ; Sun, 2 Apr 2006 09:55:07 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1FQ26j-0001jg-4I; Mon, 03 Apr 2006 00:55:05 +1200 Message-ID: <442FC9A5.6000207@opencloud.com> Date: Mon, 03 Apr 2006 00:55:01 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051009) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Amaresh Wakkar CC: pgsql-jdbc@postgresql.org Subject: Re: 25P02, current transaction is aborted, commands ignored References: <200604021130.RAA11482@WS0005.indiatimes.com> In-Reply-To: <200604021130.RAA11482@WS0005.indiatimes.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.113 required=5 tests=[AWL=0.113] X-Spam-Score: 0.113 X-Spam-Level: X-Archive-Number: 200604/9 X-Sequence-Number: 14943 Amaresh Wakkar wrote: > Thanks!! > > The code works fine after I added savepoints around "Okay,even if > fails" statement. > > What is the idea behind taking this route(i.e all statements ignored > till end of block) though? Is there any archive thread discussing this? There should be tons, it comes up regularly whenever someone ports an app from Oracle.. > In this particular case, the autocommit is off and the statement has > failed so there is no risk of changes being made permanent(presumable PG > would rollback at database level the changed buffers etc.,) unless the > commit() method is invoked. Why then explicit rollback is needed? Is it > not best if it is left to programmer to handle this in exception > handling code? There are arguments both ways. To some extent it depends on who you trust more to get the code right: the DB developer (once) or the app developer (once per query). -O