Re: Unable to commit: transaction marked for rollback

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "David Kerr" <dmk(at)mr-paradox(dot)net>,<pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Unable to commit: transaction marked for rollback
Date: 2010-07-01 18:30:59
Message-ID: 4C2C98930200002500032F20@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

David Kerr <dmk(at)mr-paradox(dot)net> wrote:

> javax.transaction.RollbackException: Unable to commit: transaction
> marked for rollback
>
> Can someone give me a scenario where this would happen?

It sounds like the right exception for the case where a previous
statement generated an error within a database transaction. After
that, any attempt to run a statement would generate this at the
PostgreSQL level:

ERROR: current transaction is aborted, commands ignored until end
of transaction block

until a ROLLBACK or COMMIT (which would be treated as a ROLLBACK
because of the transaction state) is executed.

That sounds like exactly the case for which RollbackException was
created:

http://java.sun.com/javase/6/docs/api/javax/transaction/TransactionRolledbackException.html

-Kevin

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Kerr 2010-07-01 18:57:55 Re: Unable to commit: transaction marked for rollback
Previous Message David Kerr 2010-07-01 18:15:28 Unable to commit: transaction marked for rollback