From: Mike Bayer Date: Wed, 22 Jun 2011 16:02:48 +0000 (-0400) Subject: - Added ORA-00028 to disconnect codes, use X-Git-Tag: rel_0_7_2~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6040af5d77f4cd17e63b487f088328745ad15d9e;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Added ORA-00028 to disconnect codes, use cx_oracle _Error.code to get at the code, [ticket:2200]. Also in 0.6.9. --- diff --git a/CHANGES b/CHANGES index e6ae6f1310..d8f71bbaee 100644 --- a/CHANGES +++ b/CHANGES @@ -52,6 +52,11 @@ CHANGES if Python unicodes are passed under certain circumstances. +- oracle + - Added ORA-00028 to disconnect codes, use + cx_oracle _Error.code to get at the code, + [ticket:2200]. Also in 0.6.9. + - examples - Repaired the examples/versioning test runner to not rely upon SQLAlchemy test libs, diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py index a917aac021..4f0cdffcfc 100644 --- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py +++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py @@ -686,10 +686,14 @@ class OracleDialect_cx_oracle(OracleDialect): ) def is_disconnect(self, e, connection, cursor): + error, = e.args if isinstance(e, self.dbapi.InterfaceError): return "not connected" in str(e) else: - return "ORA-03114" in str(e) or "ORA-03113" in str(e) + # ORA-00028: your session has been killed + # ORA-03114: not connected to ORACLE + # ORA-03113: end-of-file on communication channel + return error.code in (28, 3114, 3113) def create_xid(self): """create a two-phase transaction ID.