diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-30 14:22:43 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-30 14:22:43 -0500 |
| commit | 426c4356eba28f8bb25b7685e43e49e2ed1131e6 (patch) | |
| tree | cbb0ac64aa40905e96005393636a153217d724ba /lib/sqlalchemy/pool.py | |
| parent | ecf1571ba79a81567428d345a4ec10255305de97 (diff) | |
| download | sqlalchemy-426c4356eba28f8bb25b7685e43e49e2ed1131e6.tar.gz | |
- removes the "on_" prefix.
Diffstat (limited to 'lib/sqlalchemy/pool.py')
| -rw-r--r-- | lib/sqlalchemy/pool.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/sqlalchemy/pool.py b/lib/sqlalchemy/pool.py index 572087217..050b239c4 100644 --- a/lib/sqlalchemy/pool.py +++ b/lib/sqlalchemy/pool.py @@ -255,8 +255,8 @@ class _ConnectionRecord(object): self.connection = self.__connect() self.info = {} - pool.dispatch.on_first_connect.exec_once(self.connection, self) - pool.dispatch.on_connect(self.connection, self) + pool.dispatch.first_connect.exec_once(self.connection, self) + pool.dispatch.connect(self.connection, self) def close(self): if self.connection is not None: @@ -284,8 +284,8 @@ class _ConnectionRecord(object): if self.connection is None: self.connection = self.__connect() self.info.clear() - if self.__pool.dispatch.on_connect: - self.__pool.dispatch.on_connect(self.connection, self) + if self.__pool.dispatch.connect: + self.__pool.dispatch.connect(self.connection, self) elif self.__pool._recycle > -1 and \ time.time() - self.starttime > self.__pool._recycle: self.__pool.logger.info( @@ -294,8 +294,8 @@ class _ConnectionRecord(object): self.__close() self.connection = self.__connect() self.info.clear() - if self.__pool.dispatch.on_connect: - self.__pool.dispatch.on_connect(self.connection, self) + if self.__pool.dispatch.connect: + self.__pool.dispatch.connect(self.connection, self) return self.connection def __close(self): @@ -348,8 +348,8 @@ def _finalize_fairy(connection, connection_record, pool, ref, echo): if echo: pool.logger.debug("Connection %r being returned to pool", connection) - if pool.dispatch.on_checkin: - pool.dispatch.on_checkin(connection, connection_record) + if pool.dispatch.checkin: + pool.dispatch.checkin(connection, connection_record) pool._return_conn(connection_record) _refs = set() @@ -435,14 +435,14 @@ class _ConnectionFairy(object): raise exc.InvalidRequestError("This connection is closed") self.__counter += 1 - if not self._pool.dispatch.on_checkout or self.__counter != 1: + if not self._pool.dispatch.checkout or self.__counter != 1: return self # Pool listeners can trigger a reconnection on checkout attempts = 2 while attempts > 0: try: - self._pool.dispatch.on_checkout(self.connection, + self._pool.dispatch.checkout(self.connection, self._connection_record, self) return self |
