summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-02-01 10:14:28 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2012-02-01 10:14:28 -0500
commit132f5c7e0437fb62237ab33bb9dea3befd5ab233 (patch)
tree742e2239de05e23f7b6d43de1f633453cb5b0b41 /lib/sqlalchemy/engine
parent116572dadef2bf733036e345899476f2707f5414 (diff)
downloadsqlalchemy-132f5c7e0437fb62237ab33bb9dea3befd5ab233.tar.gz
- [feature] Added pool_reset_on_return argument
to create_engine, allows control over "connection return" behavior. Also added new arguments 'rollback', 'commit', None to pool.reset_on_return to allow more control over connection return activity. [ticket:2378]
Diffstat (limited to 'lib/sqlalchemy/engine')
-rw-r--r--lib/sqlalchemy/engine/__init__.py6
-rw-r--r--lib/sqlalchemy/engine/strategies.py3
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/sqlalchemy/engine/__init__.py b/lib/sqlalchemy/engine/__init__.py
index 4fac3e532..23b4b0b3b 100644
--- a/lib/sqlalchemy/engine/__init__.py
+++ b/lib/sqlalchemy/engine/__init__.py
@@ -306,6 +306,12 @@ def create_engine(*args, **kwargs):
this is configurable with the MySQLDB connection itself and the
server configuration as well).
+ :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`. (new as of 0.7.6)
+
:param pool_timeout=30: number of seconds to wait before giving
up on getting a connection from the pool. This is only used
with :class:`~sqlalchemy.pool.QueuePool`.
diff --git a/lib/sqlalchemy/engine/strategies.py b/lib/sqlalchemy/engine/strategies.py
index 7b2da68c4..e3a6c5026 100644
--- a/lib/sqlalchemy/engine/strategies.py
+++ b/lib/sqlalchemy/engine/strategies.py
@@ -108,7 +108,8 @@ class DefaultEngineStrategy(EngineStrategy):
'timeout': 'pool_timeout',
'recycle': 'pool_recycle',
'events':'pool_events',
- 'use_threadlocal':'pool_threadlocal'}
+ 'use_threadlocal':'pool_threadlocal',
+ 'reset_on_return':'pool_reset_on_return'}
for k in util.get_cls_kwargs(poolclass):
tk = translate.get(k, k)
if tk in kwargs: