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 E32E911F7957 for ; Sun, 2 Apr 2006 12:05:46 -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 84132-07 for ; Sun, 2 Apr 2006 12:05:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from WS0005.indiatimes.com (smtp5.indiatimes.com [203.199.93.15]) by postgresql.org (Postfix) with ESMTP id D31E011F6AE4 for ; Sun, 2 Apr 2006 12:05:43 -0300 (ADT) Received: from 192.168.57.15 (a2 [192.168.57.22]) by WS0005.indiatimes.com (8.9.3/8.9.3) with SMTP id TAA06182; Sun, 2 Apr 2006 19:54:35 +0530 From: "Amaresh Wakkar" Message-Id: <200604021424.TAA06182@WS0005.indiatimes.com> To: "Oliver Jowett", "Amaresh Wakkar" CC: Reply-To: "Amaresh Wakkar" Subject: Re: 25P02, current transaction is aborted, commands ignored Date: Sun, 02 Apr 2006 20:33:07 +0530 X-URL: http://indiatimes.com Content-Type: multipart/alternative; boundary="=_MAILER_ATTACH_BOUNDARY1_200642020337620688013" MIME-Version: 1.0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=2.198 required=5 tests=[AWL=-0.652, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44, HTML_IMAGE_ONLY_24=0.93, HTML_MESSAGE=0.001] X-Spam-Score: 2.198 X-Spam-Level: ** X-Archive-Number: 200604/11 X-Sequence-Number: 14945 --=_MAILER_ATTACH_BOUNDARY1_200642020337620688013 Content-Type: text/plain; charset=us-ascii "Oliver Jowett" wrote: 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.. >>>>Ok, Thanks!! > 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). >>>>> Once a statement fails, to continue further, savepoints need to be used so that postgreSQL implicit rollback is not done. If implicit rollback by postgreSQL is done, I will get 25P02 next time I try some query so I have lost the transaction anyway unless there is a way to recover from 25P02. Amaresh -O Indiatimes Email now powered by APIC Advantage. Help! " " Help --=_MAILER_ATTACH_BOUNDARY1_200642020337620688013 Content-Type: text/html; charset=us-ascii

"Oliver Jowett" wrote:


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..

>>>>Ok, Thanks!!

> 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).
>>>>> Once a statement fails, to continue further, savepoints need to be used so that postgreSQL implicit rollback is not done. If implicit rollback by postgreSQL is done, I will get 25P02 next time I try some query so I have lost the transaction anyway unless there is a way to recover from 25P02.

Amaresh 

 

-O



Indiatimes Email now powered by APIC Advantage. Help!


--=_MAILER_ATTACH_BOUNDARY1_200642020337620688013--