Re: Reg: 25P02, current transaction is aborted, commands ignored until end of transaction block - Mailing list pgsql-bugs

From toruvinn
Subject Re: Reg: 25P02, current transaction is aborted, commands ignored until end of transaction block
Date
Msg-id op.ur57x9ue33x80h@insanity.lain.pl
Whole thread Raw
In response to Reg: 25P02, current transaction is aborted, commands ignored until end of transaction block  ("Durgabhavani.g" <durgabhavani.g@ocimumbio.com>)
List pgsql-bugs
On Fri, 10 Apr 2009 11:55:03 +0200, Durgabhavani.g <durgabhavani.g@ocimumbio.com> wrote:
>     I am trying to port my application from Oracle to PostGREs. I have a
> problem while doing so. In my application i need to update record if the
> delete on the respective record is failed due to Constraint Violation.
> But SQL Error: 0, SQLState: 25P02 ERROR [JDBCExceptionReporter] ERROR:
> current transaction is aborted, commands ignored until end of
> transaction block is being generated while updating the record. But with
> Oracle i am able to do this.

What you may be looking for is described here:
http://www.postgresql.org/docs/current/interactive/sql-savepoint.html
In short: creating a savepoint, executing a query and - in case the query fails - rolling back to the savepoint created
previouslyrestores the transaction state. In your case, you should create the SAVEPOINT before executing the DELETE
query,and when it fails - ROLLBACK to the savepoint and continue normally. As far as I understand your code/intentions,
thatis. 

--
ru

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: libpq 8.4 beta1: $PGHOST complains about missing root.crt
Next
From: Martin Pitt
Date:
Subject: Re: libpq 8.4 beta1: $PGHOST complains about missing root.crt