]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix links and update verbiage for reset_on_return
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 28 Aug 2018 18:58:05 +0000 (14:58 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 28 Aug 2018 18:59:00 +0000 (14:59 -0400)
Change-Id: I642056b78570b44fdefe7f0874a8e4c720389f14
(cherry picked from commit d8bb208a85f6366c58426a85b3d4ec1d6e43ac6c)

lib/sqlalchemy/engine/__init__.py
lib/sqlalchemy/pool.py

index 033e8434a5ed4dc2053f5de991923fc42420d104..ba74f37eeeaee52b564e4fee184a583345d32763 100644 (file)
@@ -358,13 +358,14 @@ def create_engine(*args, **kwargs):
 
             :ref:`pool_setting_recycle`
 
-    :param pool_reset_on_return='rollback': set the "reset on return"
-        behavior of the pool, which is whether ``rollback()``,
-        ``commit()``, or nothing is called upon connections
-        being returned to the pool.  See the docstring for
-        ``reset_on_return`` at :class:`.Pool`.
+    :param pool_reset_on_return='rollback': set the
+        :paramref:`.Pool.reset_on_return` parameter of the underlying
+        :class:`.Pool` object, which can be set to the values
+        ``"rollback"``, ``"commit"``, or ``None``.
 
-        .. versionadded:: 0.7.6
+        .. seealso::
+
+            :paramref:`.Pool.reset_on_return`
 
     :param pool_timeout=30: number of seconds to wait before giving
         up on getting a connection from the pool. This is only used
index d2bc8f703faba90fd4c2e177605bbb0d2d8e1c4d..1a5fda4b7ec30f182f4fe93eba0cd73fa1bc3e38 100644 (file)
@@ -178,25 +178,22 @@ class Pool(log.Identified):
             any data changes present on the transaction
             are committed unconditionally.
           * ``None`` - don't do anything on the connection.
-            This setting should only be made on a database
+            This setting should generally only be made on a database
             that has no transaction support at all,
-            namely MySQL MyISAM.   By not doing anything,
-            performance can be improved.   This
-            setting should **never be selected** for a
-            database that supports transactions,
-            as it will lead to deadlocks and stale
-            state.
-          * ``"none"`` - same as ``None``
-
-            .. versionadded:: 0.9.10
+            namely MySQL MyISAM; when used on this backend, performance
+            can be improved as the "rollback" call is still expensive on
+            MySQL.   It is **strongly recommended** that this setting not be
+            used for transaction-supporting databases in conjunction with
+            a persistent pool such as :class:`.QueuePool`, as it opens
+            the possibility for connections still in a transaction to be
+            idle in the pool.   The setting may be appropriate in the
+            case of :class:`.NullPool` or special circumstances where
+            the connection pool in use is not being used to maintain connection
+            lifecycle.
 
           * ``False`` - same as None, this is here for
             backwards compatibility.
 
-          .. versionchanged:: 0.7.6
-              :paramref:`.Pool.reset_on_return` accepts ``"rollback"``
-              and ``"commit"`` arguments.
-
         :param events: a list of 2-tuples, each of the form
          ``(callable, target)`` which will be passed to :func:`.event.listen`
          upon construction.   Provided here so that event listeners