Refactor SQLite lock handling
This MR enforces the need for an active sqlite context (aka lock) when executing a statement.
This fixes a small race window in which an existing connection could be user after the database was dropped.
It might also fix some rare crashes due to improper syncronization/missing locks for some requests.
Fix #405 (closed) and #413 (closed)
I really doubt this can be backported though.
Merge request reports
Activity
Filter activity
changed milestone to %0.11.x
added bug label
added 15 commits
- 1aa51515 - sqlite: Add a base Context class
- 0c63d33c - sqlite: Add a OPEN_READ_CONTEXT helper
- e9ece72e - MediaLibrary: Ensure settings are created and loaded with sqlite locked
- e980fbfe - Ensure CheckDbModel always acquires a read context
- bc28fe6a - tests: Always acquire a read context for manual requests
- b43e7737 - Ensure a DB context is opened before executing manual requests
- 1ebfeaa8 - MediaLibrary: A read context is enough to check the DB integrity
- 9838b2f7 - Thumbnail: Remove trailing whitespace
- d2653835 - sqlite: Tools: Allow a statement to be constructed without DB handle
- a01b947e - sqlite: Don't pass a DB handle to instantiate a new Statement
- 2ad067c1 - sqlite: Connection: Privatize handle() accessor
- e1ae6148 - Remove now unused DbConnection parameter
- 9ecae343 - sqlite: Transaction: Add a commitNoUnlock() function
- a8d14a93 - MediaLibrary: Fix database recreation
- 797e6816 - MediaLibrary: Reindent after last changes
Toggle commit list
Please register or sign in to reply