Re: [psycopg] Nested transactions support for code composability

Поиск
Список
Период
Сортировка
От Christophe Pettus
Тема Re: [psycopg] Nested transactions support for code composability
Дата
Msg-id 2254562A-20C1-4A4E-86E2-2E7CB6FC3BAD@thebuild.com
обсуждение исходный текст
Ответ на Re: [psycopg] Nested transactions support for code composability  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список psycopg
> On Jan 22, 2017, at 09:57, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>
> I have not used nested transaction outside of Django's implementation of @xact() eg @atomic(). Still a little fooling
aroundwith psycopg2 code led to this: 

It would be pretty straight-forward (although I haven't done it) to do a non-Django version of xact(); you'd probably
justpass the connection object in as a parameter to the decorator. 

I've noticed that in real life the savepoint functionality is not used all that much, but it does provide a nice
consistencyto the implied semantics of the decorator, and it's great when you actually do need it. 
--
-- Christophe Pettus
   xof@thebuild.com



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: [psycopg] Nested transactions support for code composability
Следующее
От: Jonathan Rogers
Дата:
Сообщение: Re: [psycopg] Nested transactions support for code composability