Re: autocommit and Django

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Federico Di Gregorio <federico(dot)digregorio(at)dndg(dot)it>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: autocommit and Django
Date: 2011-06-14 10:23:18
Message-ID: BANLkTi=6tOcCy812_GKsXM8Bx_FD=UUoOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Tue, Jun 14, 2011 at 11:02 AM, Federico Di Gregorio
<federico(dot)digregorio(at)dndg(dot)it> wrote:

> If we don't want to wait for the #(at)§%£$! person that wrote the Django
> code to fix it we can just make .autocommit a real attribute and set the
> session autocommit mode when it is assigned True/False.

This wouldn't work as if the exception is raised it means that they
have already started a transaction, probably by setting time_zone to
chicago or something like that. The "create database" they mean to run
outside the transaction is then doomed to fail.

-- Daniele

In response to

Browse psycopg by date

  From Date Subject
Next Message W. Matthew Wilson 2011-06-19 15:21:09 Can I map "raise XXX" to some custom python exceptions?
Previous Message Karsten Hilbert 2011-06-14 10:15:39 Re: autocommit and Django