From: Philip Jenvey Date: Thu, 16 Jul 2009 01:54:22 +0000 (+0000) Subject: correct the zxJDBC disconnect matching X-Git-Tag: rel_0_6_6~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2587a5b5debbaf8a1036f03e6fccfb68b6e4efec;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git correct the zxJDBC disconnect matching --- diff --git a/lib/sqlalchemy/connectors/zxJDBC.py b/lib/sqlalchemy/connectors/zxJDBC.py index 3992ba6071..ab446c575c 100644 --- a/lib/sqlalchemy/connectors/zxJDBC.py +++ b/lib/sqlalchemy/connectors/zxJDBC.py @@ -33,12 +33,7 @@ class ZxJDBCConnector(Connector): return [[d, u, p, v], self._driver_kwargs()] def is_disconnect(self, e): - if isinstance(e, self.dbapi.ProgrammingError): - return "The cursor's connection has been closed." in str(e) or 'Attempt to use a closed connection.' in str(e) - elif isinstance(e, self.dbapi.Error): - return '[08S01]' in str(e) - else: - return False + return isinstance(e, self.dbapi.ProgrammingError) and 'connection is closed' in str(e) def _get_server_version_info(self, connection): # use connection.connection.dbversion, and parse appropriately