Re: [RESEND] Transaction auto-abort causes grief with Spring Framework

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: [RESEND] Transaction auto-abort causes grief with Spring Framework
Дата
Msg-id 87bqd6u5ki.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на [RESEND] Transaction auto-abort causes grief with Spring Framework  (Tyson Lloyd Thwaites <tyson.lloydthwaites@allianza.com.au>)
Ответы Re: [RESEND] Transaction auto-abort causes grief with Spring Framework  (Tyson Lloyd Thwaites <tyson.lloydthwaites@allianza.com.au>)
Список pgsql-general
"Tyson Lloyd Thwaites" <tyson.lloydthwaites@allianza.com.au> writes:

> Normally if we catch the exception, other dbs (Oracle, MSSQL) will let us
> keep going.

How do you catch exceptions in these other dbs?

The way to do it in Postgres is with the SAVEPOINT command.

> For example, if something goes wrong, I can't even write an event row to our
> auditing table!

This is actually a somewhat more complex example than handling an expected
error. For audit records you really want to be able to commit the audit record
independently of the rest of the transaction. These are called "autonomous
transactions" and there's no built-in support for them in Postgres but you can
put together something equivalent using dblink or a second client connection.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

В списке pgsql-general по дате отправления:

Предыдущее
От: "Phoenix Kiula"
Дата:
Сообщение: Re: Strange inconsistency with UPDATE
Следующее
От: Tyson Lloyd Thwaites
Дата:
Сообщение: Re: [RESEND] Transaction auto-abort causes grief with Spring Framework