Re: 25P02, current transaction is aborted, commands ignored - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: 25P02, current transaction is aborted, commands ignored
Date
Msg-id 442FC9A5.6000207@opencloud.com
Whole thread Raw
In response to Re: 25P02, current transaction is aborted, commands ignored  ("Amaresh Wakkar" <babu_moshay@indiatimes.com>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: 25P02, current transaction is aborted, commands ignored
Next
From: "Amaresh Wakkar"
Date:
Subject: Re: 25P02, current transaction is aborted, commands ignored