[Python-checkins] cpython (merge 3.5 -> default): [merge from 3.5] - issue27113 - Document "check_same_thread" parameter in

senthil.kumaran python-checkins at python.org
Fri Jun 3 03:04:34 EDT 2016


https://hg.python.org/cpython/rev/17c8da643065
changeset:   101648:17c8da643065
parent:      101645:8db146bec24b
parent:      101647:af1752e51a89
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Fri Jun 03 00:04:28 2016 -0700
summary:
  [merge from 3.5] - issue27113 - Document "check_same_thread" parameter in sqlite3.connect api.

Patch contributed by Dave Sawyer.

files:
  Doc/library/sqlite3.rst |  5 +++++
  1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -190,6 +190,11 @@
    any combination of :const:`PARSE_DECLTYPES` and :const:`PARSE_COLNAMES` to turn
    type detection on.
 
+   By default, *check_same_thread* is :const:`True` and only the creating thread may
+   use the connection. If set :const:`False`, the returned connection may be shared
+   across multiple threads. When using multiple threads with the same connection
+   writing operations should be serialized by the user to avoid data corruption.
+
    By default, the :mod:`sqlite3` module uses its :class:`Connection` class for the
    connect call.  You can, however, subclass the :class:`Connection` class and make
    :func:`connect` use your class instead by providing your class for the *factory*

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list