diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-04-03 16:06:06 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-04-03 16:06:06 +0000 |
| commit | 030ef1f0ef37ccaebde06e58f22cd0de5a74c5d0 (patch) | |
| tree | 2f596ed664bb60c7154c61add363d5532bb0782f /lib/sqlalchemy/pool.py | |
| parent | c416dad6c652262bafbb137e6412054481db8e2f (diff) | |
| download | sqlalchemy-030ef1f0ef37ccaebde06e58f22cd0de5a74c5d0.tar.gz | |
for #516, moved the "disconnect check" step out of pool and back into base.py. dialects have
is_disconnect() method now. simpler design which also puts control of the ultimate "execute" call back into the hands of the dialects.
Diffstat (limited to 'lib/sqlalchemy/pool.py')
| -rw-r--r-- | lib/sqlalchemy/pool.py | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/lib/sqlalchemy/pool.py b/lib/sqlalchemy/pool.py index 0b1ac2630..a617f8fec 100644 --- a/lib/sqlalchemy/pool.py +++ b/lib/sqlalchemy/pool.py @@ -126,7 +126,7 @@ class Pool(object): """ def __init__(self, creator, recycle=-1, echo=None, use_threadlocal=False, auto_close_cursors=True, - disallow_open_cursors=False, disconnect_checker=None): + disallow_open_cursors=False): self.logger = logging.instance_logger(self) self._threadconns = weakref.WeakValueDictionary() self._creator = creator @@ -135,10 +135,6 @@ class Pool(object): self.auto_close_cursors = auto_close_cursors self.disallow_open_cursors = disallow_open_cursors self.echo = echo - if disconnect_checker: - self.disconnect_checker = disconnect_checker - else: - self.disconnect_checker = lambda x: False echo = logging.echo_property() def unique_connection(self): @@ -318,22 +314,6 @@ class _CursorFairy(object): self.__parent._cursors[self] = True self.cursor = cursor - def execute(self, *args, **kwargs): - try: - self.cursor.execute(*args, **kwargs) - except Exception, e: - if self.__parent._pool.disconnect_checker(e): - self.invalidate(e=e) - raise - - def executemany(self, *args, **kwargs): - try: - self.cursor.executemany(*args, **kwargs) - except Exception, e: - if self.__parent._pool.disconnect_checker(e): - self.invalidate(e=e) - raise - def invalidate(self, e=None): self.__parent.invalidate(e=e) |
