You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2016-03-23.16:31:37.202>created_at=<Date2016-03-23.16:28:34.008>labels= ['type-bug', 'library']
title='SELECT-initiated transactions can cause "database is locked" in sqlite'updated_at=<Date2016-03-23.17:29:08.114>user='https://bugs.python.org/rhunter'
When a transaction starts with a SELECT statement this can invoke a "database is locked" error if the SELECT statement is not exhausted or explicitly closed.
This can lead to subtle "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").
The attached code demonstrates this bug and possible (unintuitive) fixes. The best workaround is to "explicitly" start a transaction in these cases by issuing a dummy DML statement. This seems very clumsy.
My proposed fix is to implicitly open a transaction before all non-DDL statements (including SELECT statements), not just DML statements.
If there won't be a fix soon, then at least the documentation should note this quirky behavior.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: