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
In shared-cache mode (disabled by default), sqlite3_key_v2() sometimes returns SQLITE_NOTADB (or SQLITE_LOCKED?) due to synchronization issues with respect to reading the database page 1 for codec verification in codec_set_to(). The core problem seems to be the synchronization of shared page cache usage and, in particular, the clearing of the page cache in order to read the page 1 from disk (cached page is decrypted and therefore useless for verifying the codec).
The text was updated successfully, but these errors were encountered:
Also quick note about the suggested fix (1) which may feel like the obvious solution. I'd argue that is not necessarily the case because the current approach of accessing the database through SQLite3's abstractions (page cache etc.) may be flawed to begin with. SQLite3's internals have not been designed this use case in mind, which complicates the implementation. For example, dirty hacks may be needed to workaround limitations of programming interfaces (e.g., API offers table-based locking of shared cache, but page-level locks are required).
Thus, alternative approaches such as the fix (2) may produce more elegant and "correct" final result.
In shared-cache mode (disabled by default),
sqlite3_key_v2()
sometimes returnsSQLITE_NOTADB
(orSQLITE_LOCKED
?) due to synchronization issues with respect to reading the database page 1 for codec verification incodec_set_to()
. The core problem seems to be the synchronization of shared page cache usage and, in particular, the clearing of the page cache in order to read the page 1 from disk (cached page is decrypted and therefore useless for verifying the codec).The text was updated successfully, but these errors were encountered: