logo       

executescript does not end the transaction: msg#00051

python.db.pysqlite.user

Subject: executescript does not end the transaction

Hello,

I'm using executescript to load a bulk of DML statements.
If one of those DML raises an error then the executescript command
aborts: previous DML in the command are not rollback, further DML and
the offending one are discarded. Good.
The problem is when the DMLs are encapsulated in a BEGIN ... COMMIT
clause: if something goes wrong then the transaction is still alive
outside executescript and this causes exception when opening a new
transaction thereafter.

I attach a py script that reproduce this and the corresponding sql
script that shows that sqlite does not have this problem, so I suppose
it is a bug in executescript.

config: pysqlite 2.2.2 and python 2.4.

--
jt


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise