Closed teetone closed 2 years ago
The code inside the context manager (the with
block = one SqliteDict
database connection) is thread-safe.
But opening multiple connections (multiple with
blocks concurrently) – not so much. The underlying database engine, SQLite, offers only limited support for this, see its FAQ. Definitely not in scope for sqlitedict
, which handles thread-safety within a single process, a single SqliteDict
object = database connection.
If you need to coordinate read/write access across multiple processes, an embedded DB like SQLite is the wrong tool.
Hello, I was looking through the documentation and was wondering if the following code was thread-safe without any additional locks: