logo       

Re: executescript does not end the transaction: msg#00053

python.db.pysqlite.user

Subject: Re: executescript does not end the transaction

jt wrote:

> 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

Hello, perhaps I'm misunderstanding. But may be you can connect to
the database with isolation_level=None. So you can use begin and
commit. Or does executescript commit regardless of that? Regards,
Edzard Pasma.


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

News | FAQ | advertise