diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-29 02:01:11 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-29 02:01:11 +0000 |
commit | a04c4dc42cf4c3c35163b59a78f05efe47547dc0 (patch) | |
tree | 4d21f99e6d5ada6c701ea77e824163482f818896 /lib/sqlalchemy/engine/base.py | |
parent | e78cee66186b8851a5018e32f6935ca72be0cf7e (diff) | |
download | sqlalchemy-a04c4dc42cf4c3c35163b59a78f05efe47547dc0.tar.gz |
- inline some code and turn some instance-level defaults into class level
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 3d192a9be..6e4a34219 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -732,7 +732,7 @@ class Connection(Connectable): self.engine = engine self.__connection = connection or engine.raw_connection() self.__transaction = None - self.__close_with_result = close_with_result + self.should_close_with_result = close_with_result self.__savepoint_seq = 0 self.__branch = _branch self.__invalid = False @@ -799,14 +799,6 @@ class Connection(Connectable): raise exc.InvalidRequestError("This Connection is closed") @property - def should_close_with_result(self): - """Indicates if this Connection should be closed when a corresponding - ResultProxy is closed; this is essentially an auto-release mode. - """ - - return self.__close_with_result - - @property def info(self): """A collection of per-DB-API connection instance properties.""" @@ -1080,7 +1072,7 @@ class Connection(Connectable): def _execute_default(self, default, multiparams, params): ctx = self.__create_execution_context() ret = ctx._exec_default(default) - if self.__close_with_result: + if self.should_close_with_result: self.close() return ret @@ -1161,7 +1153,7 @@ class Connection(Connectable): if cursor: cursor.close() self._autorollback() - if self.__close_with_result: + if self.should_close_with_result: self.close() # Py3K #raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect) from e |