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
Ответ на
Список
Дерево обсуждения
[psycopg] Nested transactions support for code composability Daniel Fortunov <psycopg-list@danielfortunov.com>
Re: [psycopg] Nested transactions support for code composability Christophe Pettus <xof@thebuild.com>
Re: [psycopg] Nested transactions support for code composability Daniel Fortunov <psycopg-list@danielfortunov.com>
Re: [psycopg] Nested transactions support for code composability Christophe Pettus <xof@thebuild.com>
Re: [psycopg] Nested transactions support for code composability Jonathan Rogers <jrogers@emphasys-software.com>
Re: [psycopg] Nested transactions support for code composability Adrian Klaver <adrian.klaver@aklaver.com>
Re: [psycopg] Nested transactions support for code composability Christophe Pettus <xof@thebuild.com>
Re: Nested transactions support for code composability Daniel Fortunov <psycopg-list@danielfortunov.com>
Re: Nested transactions support for code composability Reuben Rissler <silrep@emypeople.net>
Re: Nested transactions support for code composability Christophe Pettus <xof@thebuild.com>
Nested transactions support for code composability Daniel Fortunov <postgresql@danielfortunov.com>
Re: Nested transactions support for code composability Daniele Varrazzo <daniele.varrazzo@gmail.com>

> On Jan 22, 2017, at 09:57, Adrian Klaver  wrote:
> 
> I have not used nested transaction outside of Django's implementation of @xact() eg @atomic(). Still a little fooling around with 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 just pass 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 consistency to the implied semantics of the decorator, and it's great when you actually do need it.
--
-- Christophe Pettus
   xof@thebuild.com


В списке psycopg по дате отправления
От: Adrian Klaver
Дата:
От: Jonathan Rogers
Дата:
FAQ