[issue16509] sqlite3 docs do not explain check_same_thread
New submission from Daniel Micay: The sqlite3 documentation now includes a Multithreading section explaining issues with older sqlite versions, but still doesn't directly cover disabling check_same_thread beyond listing it as a possible parameter. As far as I can tell, reusing sqlite connections in different threads (such as from a pool) is safe, as long as no attempt is made to use them from multiple threads with no locking. ---------- assignee: docs@python components: Documentation messages: 175946 nosy: docs@python, strcat priority: normal severity: normal status: open title: sqlite3 docs do not explain check_same_thread type: enhancement versions: Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16509> _______________________________________
Changes by Ezio Melotti <ezio.melotti@gmail.com>: ---------- nosy: +ghaering stage: -> needs patch versions: +Python 3.2, Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16509> _______________________________________
Changes by R. David Murray <rdmurray@bitdance.com>: ---------- nosy: +r.david.murray _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16509> _______________________________________
Changes by Thomas Kluyver <takowl@gmail.com>: ---------- nosy: +takluyver _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16509> _______________________________________
Mark Lawrence added the comment: @Daniel could you provide a patch for this? ---------- nosy: +BreamoreBoy _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16509> _______________________________________
Thomas Kluyver added the comment: The module docs do mention "Older SQLite versions had issues with sharing connections between threads." Presumably that means that sharing the connection between threads is safe so long as you're not using 'older versions', but it would be nice to have some more clarity about how old those versions are. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16509> _______________________________________
Thomas Kluyver added the comment: This page also looks relevant: sqlite can be compiled or used in three different threading modes. Presumably Python compiles/initialises it in the serialised mode, which makes it safe to use a connection from different threads. http://www.sqlite.org/threadsafe.html ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16509> _______________________________________
Berker Peksag added the comment: Issue 27113 has a patch and more detailed description so I'm going to close this one as a 'duplicate'. Thanks for the report! ---------- nosy: +berker.peksag resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> sqlite3 connect parameter "check_same_thread" not documented _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16509> _______________________________________
participants (6)
-
Berker Peksag
-
Daniel Micay
-
Ezio Melotti
-
Mark Lawrence
-
R. David Murray
-
Thomas Kluyver