Thread: Don't understand transaction error
I'm getting the following error when attempting to use my application: ERROR: current transaction is aborted, commands ignored until end of transaction block I have no clue... the only idea I have is to somehow release any transaction locks, but I don't how to list, or even if possible, to list current locks. If there is a way to do this, perhaps I can release it. But I don't know how to release it either *shrug*
On Thu, 2005-09-01 at 10:36, Jonathan Villa wrote: > I'm getting the following error when attempting to use my application: > > ERROR: current transaction is aborted, commands ignored until end of > transaction block > > I have no clue... the only idea I have is to somehow release any > transaction locks, but I don't how to list, or even if possible, to list > current locks. If there is a way to do this, perhaps I can release it. > But I don't know how to release it either What you're seeing is the standard way postgresql handles transactins. Any error in a transaction, and all of it is rolled back. Since the database knows it's going to roll back everything, when you tell it to do something without ending the transaction, it emits this error, telling you that whatever your asking it to do ain't gonna get done. begin starts a transaction, rollback ends one and rolls back all changes, commit commits the changes IF THERE WERE NO ERRORS (note that savepoints allow you to work around this limitation). There's a chapter on this behavior in the manual, under something to do with transactions...
Jonathan Villa wrote: > I'm getting the following error when attempting to use my application: > > ERROR: current transaction is aborted, commands ignored until end of > transaction block > > I have no clue... An error has occurred on a previous command. As a result, this transaction is aborted and you should issue ROLLBACK to cancel it. There should be another error previously that causes this. -- Richard Huxton Archonet Ltd
On Thu, Sep 01, 2005 at 10:36:07AM -0500, Jonathan Villa wrote: > I'm getting the following error when attempting to use my application: > > ERROR: current transaction is aborted, commands ignored until end of > transaction block Some earlier command failed so the entire transaction (or subtransaction) has failed and no further commands will be allowed; you'll have to issue a ROLLBACK and then start a new transaction (or issue ROLLBACK TO SAVEPOINT if you're using savepoints, which are available in 8.0 and later). If you're doing adequate error checking then you should be able to find out which command failed and why. -- Michael Fuhr