diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-10-27 18:45:20 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-10-27 18:45:20 +0000 |
commit | 1fee09fd07f6507657d28e542d725c9e7845cc31 (patch) | |
tree | 71f21102b63d1c3b51a957fa72453eb716d80fe8 /lib/sqlalchemy/engine/base.py | |
parent | 4a4daad81a6c5f987ac6eba0afdaccb3a70554f8 (diff) | |
download | sqlalchemy-1fee09fd07f6507657d28e542d725c9e7845cc31.tar.gz |
- inlined a couple of context variables
- PG two phase was calling text() without the correct bind param format, previous compiler checkin revealed issue
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 131f50540..880362938 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -671,32 +671,30 @@ class Connection(Connectable): return self.__transaction is not None def _begin_impl(self): - if self.__connection.is_valid: - if self.__engine._should_log_info: - self.__engine.logger.info("BEGIN") - try: - self.__engine.dialect.do_begin(self.connection) - except Exception, e: - raise exceptions.DBAPIError.instance(None, None, e) + if self.__engine._should_log_info: + self.__engine.logger.info("BEGIN") + try: + self.__engine.dialect.do_begin(self.__connection) + except Exception, e: + raise exceptions.DBAPIError.instance(None, None, e) def _rollback_impl(self): if self.__connection.is_valid: if self.__engine._should_log_info: self.__engine.logger.info("ROLLBACK") try: - self.__engine.dialect.do_rollback(self.connection) + self.__engine.dialect.do_rollback(self.__connection) except Exception, e: raise exceptions.DBAPIError.instance(None, None, e) self.__transaction = None def _commit_impl(self): - if self.__connection.is_valid: - if self.__engine._should_log_info: - self.__engine.logger.info("COMMIT") - try: - self.__engine.dialect.do_commit(self.connection) - except Exception, e: - raise exceptions.DBAPIError.instance(None, None, e) + if self.__engine._should_log_info: + self.__engine.logger.info("COMMIT") + try: + self.__engine.dialect.do_commit(self.__connection) + except Exception, e: + raise exceptions.DBAPIError.instance(None, None, e) self.__transaction = None def _savepoint_impl(self, name=None): @@ -1307,6 +1305,7 @@ class ResultProxy(object): self.dialect = context.dialect self.closed = False self.cursor = context.cursor + self.connection = context.root_connection self.__echo = context.engine._should_log_info if context.is_select(): self._init_metadata() @@ -1315,8 +1314,6 @@ class ResultProxy(object): self._rowcount = context.get_rowcount() self.close() - connection = property(lambda self:self.context.root_connection) - def _get_rowcount(self): if self._rowcount is not None: return self._rowcount |