[issue30593] sqlite3 executescript does not respect isolation_level?

Noah Levitt report at bugs.python.org
Mon Jun 12 15:33:04 EDT 2017


Noah Levitt added the comment:

And here's a fix.

Unfortunately I think the change could break people's scripts. If they have isolation_level set (not None) and use executescript(), they will have to issue an explicit call to connection.commit().

executescript() could do the commit itself explicitly after running the sql, I suppose. Then the behavior is much like the old behavior, but at least you get the performance boost of running inside a transaction. (Substantial if you pass 10k insert statements to executescript(), or something like that.)

Or, we could not change the code, and instead change the documentation. The docs could suggest wrapping the sql script with "begin;" and "commit;".

----------
keywords: +patch
Added file: http://bugs.python.org/file46942/issue30593-fix.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30593>
_______________________________________


More information about the Python-bugs-list mailing list