Re: autonomous transactions

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема Re: autonomous transactions
Дата
Msg-id CAASwCXet43Rjf+-vZoCTtvi=3auLtA3wCtdSFW5M0uYY+49Y-A@mail.gmail.com
обсуждение исходный текст
Ответ на autonomous transactions  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: autonomous transactions  (Jaime Casanova <jaime.casanova@2ndquadrant.com>)
Re: autonomous transactions  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
I would love to see autonomous transactions in core.

I just have one major concern, but thankfully it's easily addressed.

There should be a way to within the session and/or txn permanently
block autonomous transactions.

This is important if you as a caller function want to be sure none of
the work made by anything called down the stack gets committed.
That is, if you as a caller decide to rollback, e.g. by raising an
exception, and you want to be sure *everything* gets rollbacked,
including all work by functions you've called.

If the caller can't control this, then the author of the caller
function would need to inspect the source code of all function being
called, to be sure there are no code using autonomous transactions.

Coding conventions, rules and discipline are all good and will help
against misuse of the feature, but some day someone will make a
mistake and wrongly use the autonomous transaction and cause unwanted
unknown side-effect I as a caller function didn't expect or know
about.

Once you have blocked autonomous transactions in a session or txn,
then any function called must not be able to unblock it (in the
session or txn), otherwise it defeats the purpose.



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: identity columns
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: ICU integration