Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review use of threadsafety in sqlite #656

Closed
tcompa opened this issue Apr 28, 2023 · 1 comment
Closed

Review use of threadsafety in sqlite #656

tcompa opened this issue Apr 28, 2023 · 1 comment
Assignees

Comments

@tcompa
Copy link
Collaborator

tcompa commented Apr 28, 2023

@tcompa
Copy link
Collaborator Author

tcompa commented May 8, 2023

On my machine:

>>> import sqlite3
>>> sqlite3.threadsafety
1
>>> 

which maps to SQLITE_THREADSAFE=1, that is "Threads may share the module, but not connections". More explicitly:

Multi-thread: In this mode, SQLite can be safely used by multiple threads provided that no single database connection is used simultaneously in two or more threads.

As of #664, when using sqlite we fall back onto StaticPool: "A Pool of exactly one connection, used for all requests.". This seems to solve (or at least mitigate) known issues (as in #661).

It is possible that switching to a different sqlite3 version, with higher threadsafety (coming from a different SQLITE_THREADSAFE of the underlying library), would also solve the known issues. We did not test this idea, because in practice it would introduce a complex set of dependencies.

Closing for now.

@tcompa tcompa closed this as completed May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant