Re: Transaction control overhauling

Поиск
Список
Период
Сортировка
От Oswaldo
Тема Re: Transaction control overhauling
Дата
Msg-id 4DCBF979.5030209@soft-com.es
обсуждение исходный текст
Ответ на Re: Transaction control overhauling  (Federico Di Gregorio <federico.digregorio@dndg.it>)
Ответы Re: Transaction control overhauling
Список psycopg
El 12/05/2011 16:07, Federico Di Gregorio escribió:
> 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.)
>

Another way is setting transacion mode with predefined constants and
combining it with '|':

previous_mode = conn.set_transaction(psycppg2.TM_SERIALIZABLE |
psycppg2.TM_READONLY)



--
Oswaldo Hernández

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

Предыдущее
От: Daniele Varrazzo
Дата:
Сообщение: Re: Transaction control overhauling
Следующее
От: Federico Di Gregorio
Дата:
Сообщение: Re: Transaction control overhauling