Re: [psycopg] Nested transactions support for code composability - Mailing list psycopg

From Christophe Pettus
Subject Re: [psycopg] Nested transactions support for code composability
Date
Msg-id 2254562A-20C1-4A4E-86E2-2E7CB6FC3BAD@thebuild.com
Whole thread Raw
In response to Re: [psycopg] Nested transactions support for code composability  (Adrian Klaver <adrian.klaver@aklaver.com>)
List 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 by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: [psycopg] Nested transactions support for code composability
Next
From: Jonathan Rogers
Date:
Subject: Re: [psycopg] Nested transactions support for code composability