Re: Transaction control overhauling - Mailing list psycopg

From Daniele Varrazzo
Subject Re: Transaction control overhauling
Date
Msg-id BANLkTikJnMXGPC=T7Fpwu97yNhh87ieEMg@mail.gmail.com
Whole thread Raw
In response to Re: Transaction control overhauling  (Federico Di Gregorio <federico.digregorio@dndg.it>)
List psycopg
On Thu, May 12, 2011 at 3:07 PM, Federico Di Gregorio
<federico.digregorio@dndg.it> wrote:
> On 12/05/11 12:36, Daniele Varrazzo wrote:
> [snip]
>>> Or,
>>> maybe even better, we can have 4 attributes and the set_transaction() as
>>> a shortcut:
>>>
>>>        conn.autocommit
>>>        conn.transaction_isolation_level
>>>        conn.transaction_readonly
>>>        conn.transaction_deferrable
>>>        conn.set_transaction(isolation_level, autocommit, readonly, ...)
>>
>> Wow, I thought you wanted to limit the dbapi extensions :)
>
> Well, I know. But, in fact, if we introduce the possibility to set such
> parameters we also _need_ a way to retrieve them and attributes are the
> only sensible way to retrive them (a function returning a tuple is
> another way but stinks.)

I was thinking about documenting that you can issue "SHOW
default_whatever" and get the result from there. It isn't the handiest
of the procedures, OTOH it's also not a very common use case not
knowing what the level is and wanting to know it - the biggest use
case is just to set the level desired and use the connection. This
possibility is not available with "autocommit" instead, as it's
something all internal to the connection object and not related to the
PG session.

-- Daniele

psycopg by date:

Previous
From: Federico Di Gregorio
Date:
Subject: Re: Transaction control overhauling
Next
From: Oswaldo
Date:
Subject: Re: Transaction control overhauling