Re: sqlite savepoint problem [solved]

2010-03-15 Thread Laszlo Nagy
No it doesn't. The problem is that using a connection as a context manager doesn't do what you think. It does *not* start a new transaction on __enter__ and commit it on __exit__. As far as I can tell it does nothing on __enter__ and calls con.commit() or con.rollback() on exit. With

Re: sqlite savepoint problem [solved]

2010-03-15 Thread Laszlo Nagy
Annotating your example: # entering this context actually does nothing with conn: # a transaction is magically created before this statement conn.execute(insert into a values (1)) # and is implicitly committed before this statement conn.execute(SAVEPOINT sp1)

Re: sqlite savepoint problem [solved]

2010-03-15 Thread Ryan Kelly
On Fri, 2010-03-12 at 09:35 +0100, Laszlo Nagy wrote: No it doesn't. The problem is that using a connection as a context manager doesn't do what you think. It does *not* start a new transaction on __enter__ and commit it on __exit__. As far as I can tell it does nothing on __enter__

Re: sqlite savepoint problem [solved]

2010-03-15 Thread Laszlo Nagy
#1. By using isolation_level = None, connection objects (used as a context manager) WON'T automatically commit or rollback transactions. #2. Using any isolation level, connection objects WON'T automatically begin a transaction. #3. Possibly, include your connection manager class code, to show