]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
correct the zxJDBC disconnect matching
authorPhilip Jenvey <pjenvey@underboss.org>
Thu, 16 Jul 2009 01:54:22 +0000 (01:54 +0000)
committerPhilip Jenvey <pjenvey@underboss.org>
Thu, 16 Jul 2009 01:54:22 +0000 (01:54 +0000)
lib/sqlalchemy/connectors/zxJDBC.py

index 3992ba60715b958e41472f7d483a2539ba339188..ab446c575c49032283b24d5df4bdb0d2235dd86a 100644 (file)
@@ -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