[issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec

Rian Hunter report at bugs.python.org
Wed Mar 23 12:38:51 EDT 2016


Rian Hunter added the comment:

This bug can also lead to subtle and unintuitive "database is locked" bugs, even when a large timeout is set on the connection. Many, many people are affected by this bug (search the web for "python sqlite database is locked"). I've attached code that demonstrates this issue.

I disagree that the current behavior cuts down on SQLite file locking. As soon as any SELECT statement is opened, an implicit lock is held by SQLite (whether it resides within a BEGIN block or not): https://www.sqlite.org/lockingv3.html

SQLite has been designed to do its own "late locking." Pysqlite does not need to duplicate this behavior.

This is a clear-as-day bug and should be fixed.

----------
nosy: +rhunter
Added file: http://bugs.python.org/file42260/unintuitive_sqlite_behavior.py

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


More information about the Python-bugs-list mailing list