On Thu, May 12, 2011 at 00:43, Daniele Varrazzo
<daniele.varrazzo@gmail.com> wrote:
> Hello,
A couple of quick notes (don't know enough to answer the implementation details)
> 2. when starting a transaction, it executes "begin; set isolation
> level LEVEL" after what received in 1.
You are aware this can be done in one query, right? just "BEGIN
ISOLATION LEVEL SERIALIZABLE".. That should be marginally more
efficient.
> I. don't issue any query at startup and, by default, don't pass any
> isolation level together with BEGIN:
That seems very reasonable, particularly the first one :-)
> 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.
> VI. don't write so many lists in a single email anymore: I'm out of alphabets.
Nah, just switch alphabet!
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/