Re: [psycopg] Nested transactions support for code composability

Поиск
Список
Период
Сортировка
От Jonathan Rogers
Тема Re: [psycopg] Nested transactions support for code composability
Дата
Msg-id 88f1789c-6b11-162e-16ce-21efea209655@emphasys-software.com
обсуждение исходный текст
Ответ на Re: [psycopg] Nested transactions support for code composability  (Christophe Pettus <xof@thebuild.com>)
Список psycopg
On 01/22/2017 12:22 PM, Christophe Pettus wrote:
>
>> On Jan 22, 2017, at 08:49, Daniel Fortunov <psycopg-list@danielfortunov.com> wrote:
>> So what am I missing? Doesn't anyone find the need for this outside of Django?!
>
> Mostly, it's that relatively few people use raw psycopg2 for database access in substantial applications; they all
usesome kind of framework (SQL Alchemy, Django) that mediates between the database and application.  Thus, adding this
kindof "nested" transaction support has to be done in concert with the framework. 
>
> It for sure can be done outside of any framework; there's nothing all that Django specific about xact(), in
particular.
> --

I implemented nested transactions in a custom psycopg2 wrapper. Later, I
discovered that SQLAlchemy also has nested transactions. It's simple
enough to implement that it's probably been done many times.

--
Jonathan Rogers
Socialserve.com by Emphasys Software
jrogers@emphasys-software.com


Вложения

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

Предыдущее
От: Christophe Pettus
Дата:
Сообщение: Re: [psycopg] Nested transactions support for code composability
Следующее
От: Aryeh Leib Taurog
Дата:
Сообщение: Re: [psycopg] speed concerns with executemany()