autocommit and Django

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: psycopg(at)postgresql(dot)org
Subject: autocommit and Django
Date: 2011-06-14 09:42:15
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: psycopg


the connection.autocommit feature has created the problem shown here:

I've taken a look and they have a set_autocommit method
implemented in a painful way: instead of being driver-specific they
just invoke some random method on the connection, and the thing is
compounds with the fact they *don't even know* there is a transaction
somehow already open. As per discussion
psycopg's set_session gives an error if invoked in a transaction.

Now, I would love to argue that Django's set_autocommit is written
with the wrong anatomical part, the bug is theirs and it's all their
problem. However, knowing the painful process they use to fix a bug I
wouldn't be surprised it would take months (see how they handled the
idle in transaction mess) and this would only be a problem for django,
postgres and psycopg users, as 2.4.2 is the version installed by
default by easy_install and friends. So I'm positive to change the
semantics of set_session/autocommit and issue an implicit rollback if
in transaction instead of raising an exception, as set_isolation_level


-- Daniele


Browse psycopg by date

  From Date Subject
Next Message Karsten Hilbert 2011-06-14 09:59:17 Re: autocommit and Django
Previous Message Federico Di Gregorio 2011-06-13 16:53:03 RELEASE: psycopg 2.4.2