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