From: | Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com> |
---|---|
To: | Magnus Hagander <magnus(at)hagander(dot)net> |
Cc: | psycopg(at)postgresql(dot)org |
Subject: | Re: Transaction control overhauling |
Date: | 2011-05-12 12:52:47 |
Message-ID: | BANLkTim-hk7gCVBB5-sF0mwK74a+++Pf+w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | psycopg |
On Thu, May 12, 2011 at 12:57 PM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
>> II. add a method conn.set_transaction(isolation_level=None,
>> read_only=None, deferrable=None) allowing to change one or more of the
>> transaction settings. Calling the method would terminate the current
>> transaction and put the new settings in place. Note that there are
>> several ways for implementing this:
>
> Ugh. Big -1 on the "terminate current transaction". First of all, I
> *assume* you mean ROLLBACK and not COMMIT. But even so, I think it's a
> much better idea to raise a local exception when trying to change it
> while inside a transaction.
Yes, the idea was to issue a rollback. This is the current behaviour
of set_isolation_level(). No problem in having an exception raised
instead: it seems actually a better defined behaviour.
-- Daniele
From | Date | Subject | |
---|---|---|---|
Next Message | Federico Di Gregorio | 2011-05-12 14:07:16 | Re: Transaction control overhauling |
Previous Message | Federico Di Gregorio | 2011-05-12 12:13:09 | Re: Transaction control overhauling |