mirror of
https://github.com/python/cpython.git
synced 2025-10-01 04:42:10 +00:00
Issue #3854: Documented using the sqlite3 module with multiple threads.
This commit is contained in:
parent
e56a386e0e
commit
5d8cd24100
1 changed files with 15 additions and 0 deletions
|
@ -840,3 +840,18 @@ exception, the transaction is rolled back; otherwise, the transaction is
|
||||||
committed:
|
committed:
|
||||||
|
|
||||||
.. literalinclude:: ../includes/sqlite3/ctx_manager.py
|
.. literalinclude:: ../includes/sqlite3/ctx_manager.py
|
||||||
|
|
||||||
|
|
||||||
|
Common issues
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Multithreading
|
||||||
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Older SQLite versions had issues with sharing connections between threads.
|
||||||
|
That's why the Python module disallows sharing connections and cursors between
|
||||||
|
threads. If you still try to do so, you will get an exception at runtime.
|
||||||
|
|
||||||
|
The only exception is calling the :meth:`~Connection.interrupt` method, which
|
||||||
|
only makes sense to call from a different thread.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue