From: Mike Bayer Date: Fri, 17 Mar 2006 21:22:30 +0000 (+0000) Subject: attempting to catch OperationalErrors and invalidate the connection X-Git-Tag: rel_0_1_5~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b4c64fdfbc6f684f672bd131024a15725186066;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git attempting to catch OperationalErrors and invalidate the connection --- diff --git a/lib/sqlalchemy/engine.py b/lib/sqlalchemy/engine.py index 482aa4270e..d4f01f174c 100644 --- a/lib/sqlalchemy/engine.py +++ b/lib/sqlalchemy/engine.py @@ -686,6 +686,9 @@ class SQLEngine(schema.SchemaEngine): parameters = {} try: c.execute(statement, parameters) + except self.dbapi().OperationalError, e: + c.parent.invalidate() + raise exceptions.SQLError(statement, parameters, e) except Exception, e: raise exceptions.SQLError(statement, parameters, e) self.context.rowcount = c.rowcount