sqlite savepoint problem (was: Re: sqlite3 is sqlite 2?)

Laszlo Nagy gandalf at shopzeus.com
Fri Mar 12 07:46:48 CET 2010


>
> That's the sqlite *bindings* version:
>
>   >>> sqlite3.version
>   '2.4.1'
>   >>> sqlite3.sqlite_version
>   '3.6.16'
>   >>>

Thanks. I tried it and RELEASE command didn't work:

 >>> import sqlite3
 >>> conn = sqlite3.connect(':memory:')
 >>> with conn:
...     conn.execute("BEGIN")
...     conn.execute("create table a ( i integer)")
...     conn.execute("insert into a values (1)")
...     conn.execute("savepoint sp1")
...     conn.execute("insert into a values(2)")
...     conn.execute("release sp1")
...     conn.execute("COMMIT")
...
<sqlite3.Cursor object at 0xb7e29b30>
<sqlite3.Cursor object at 0xb7e29b60>
<sqlite3.Cursor object at 0xb7e29b30>
<sqlite3.Cursor object at 0xb7e29b60>
<sqlite3.Cursor object at 0xb7e29b30>
Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
sqlite3.OperationalError: no such savepoint: sp1
 >>>


The syntax is correct: http://www.sqlite.org/lang_savepoint.html
The savepoint was really created.
But I get this error, telling "no such savepoint". What is wrong here? 
Maybe it has to do something with transaction isolation? :-s

Thank you

   Laszlo




More information about the Python-list mailing list