Skip site navigation (1) Skip section navigation (2)

Re: Transaction control overhauling

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 (view raw or flat)
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

In response to

psycopg by date

Next:From: Federico Di GregorioDate: 2011-05-12 14:07:16
Subject: Re: Transaction control overhauling
Previous:From: Federico Di GregorioDate: 2011-05-12 12:13:09
Subject: Re: Transaction control overhauling

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group