diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-01-16 17:04:07 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-01-16 17:04:07 -0500 |
| commit | 7325ba60bce50c63ce83fcb44f6b337664262ad0 (patch) | |
| tree | 3ead541a555e1fda9f57173ab836d60334a9e3b1 /lib/sqlalchemy/pool.py | |
| parent | 8259e2fd2bb183bdcbc019bd03a281f411c80307 (diff) | |
| download | sqlalchemy-7325ba60bce50c63ce83fcb44f6b337664262ad0.tar.gz | |
- execution_options() on Connection accepts
"isolation_level" argument, sets transaction isolation
level for that connection only until returned to the
connection pool, for thsoe backends which support it
(SQLite, Postgresql) [ticket:2001]
- disallow the option on Engine (use isolation_level to create_engine()),
Executable (we don't want to check/set per statement)
- docs
Diffstat (limited to 'lib/sqlalchemy/pool.py')
| -rw-r--r-- | lib/sqlalchemy/pool.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/pool.py b/lib/sqlalchemy/pool.py index 23a4c6946..5150d282c 100644 --- a/lib/sqlalchemy/pool.py +++ b/lib/sqlalchemy/pool.py @@ -249,6 +249,8 @@ class Pool(log.Identified): class _ConnectionRecord(object): + finalize_callback = None + def __init__(self, pool): self.__pool = pool self.connection = self.__connect() @@ -347,6 +349,9 @@ def _finalize_fairy(connection, connection_record, pool, ref, echo): if echo: pool.logger.debug("Connection %r being returned to pool", connection) + if connection_record.finalize_callback: + connection_record.finalize_callback(connection) + del connection_record.finalize_callback if pool.dispatch.checkin: pool.dispatch.checkin(connection, connection_record) pool._return_conn(connection_record) |
