Re: Reg: 25P02, current transaction is aborted, commands ignored until end of transaction block

From: toruvinn <toruvinn(at)lain(dot)pl>
To: "Durgabhavani(dot)g" <durgabhavani(dot)g(at)ocimumbio(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Reg: 25P02, current transaction is aborted, commands ignored until end of transaction block
Date: 2009-04-10 12:35:59
Message-ID: op.ur57x9ue33x80h@insanity.lain.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, 10 Apr 2009 11:55:03 +0200, Durgabhavani.g <durgabhavani(dot)g(at)ocimumbio(dot)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 previously restores 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, that is.

--
ru

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Martin Pitt 2009-04-10 14:13:55 Re: libpq 8.4 beta1: $PGHOST complains about missing root.crt
Previous Message Peter Eisentraut 2009-04-10 11:56:20 Re: libpq 8.4 beta1: $PGHOST complains about missing root.crt