Re: autonomous transactions

Поиск
Список
Период
Сортировка
От Gokulakannan Somasundaram
Тема Re: autonomous transactions
Дата
Msg-id 9362e74e0801231247o16dca7e7xdf317c5b02876ed1@mail.gmail.com
обсуждение исходный текст
Ответ на Re: autonomous transactions  (Gregory Stark <stark@enterprisedb.com>)
Ответы Re: autonomous transactions  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers


I think the hard part would be error handling. You have to be able to catch
any errors and resume the outer transaction.
 
I think this is not right. Autonomous transactions are used as soon as you catch a error in order to log them. It can be used even for auditing. But resuming the outer transaction etc should not be on the plate of autonomous transactions. I am making an example here ...

Suppose you want to write a code which captures the attempt to change the sensitive information, and also fails the change made to sensitive information. In order to fail the change, we might need to rollback the transaction, which would prevent the attempt being logged. So if we have autonomous audit transaction, it will commit irrespective of the rollback which happened to the original transaction

The Audit transaction, which is a autonomous transaction need not catch any error and resume the outer transaction.

Thanks,
Gokul.

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

Предыдущее
От: "Guillaume Smet"
Дата:
Сообщение: Re: Thick indexes - a look at count(1) query
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: autonomous transactions