Re: Recovering from failed transaction

Поиск
Список
Период
Сортировка
Искать
От
Jeff Janes
Тема
Re: Recovering from failed transaction
Дата
Msg-id
CAMkU=1ySYe7GAfSTVRwoJnCmfLb9s31WFph5ARPQ-CVBZq0_RA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Recovering from failed transaction Brian Crowell <brian@fluggo.com>
Re: Recovering from failed transaction Jeff Janes <jeff.janes@gmail.com>
Re: Recovering from failed transaction Brian Crowell <brian@fluggo.com>
Re: Recovering from failed transaction "Francisco Figueiredo Jr." <francisco@npgsql.org>
On Mon, Mar 10, 2014 at 1:41 PM, Brian Crowell <brian@fluggo.com> wrote:
I feel dumb asking this question, but I can't seem to find the answer online.

I'm running serializable transactions, and so naturally, they will
sometimes fail with the error "could not serialize access due to
concurrent update."

But then I try to issue a ROLLBACK so I can continue using the
connection, and I get error 25P02: "current transaction is aborted,
commands ignored until end of transaction block."

...doesn't "ROLLBACK" end a transaction block? What does Postgres want
here? How can I retry without closing the connection altogether?

What tool are you using to connect to the database?  Perhaps it is confusing the error response to some earlier statement in the stream with the response for the rollback.  Or maybe it is mangling the "ROLLBACK;" into some form the database doesn't recognize.  Look in the postgres log files to see what the events look like from PostgreSQL's perspective.

Cheers,

Jeff
В списке pgsql-general по дате отправления
От: Brian Crowell
Дата:
От: Matthew Chambers
Дата:
FAQ