From 03255a5a0fc6aa8acfff99ed9e62d58054b8b6af Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 18 Aug 2017 13:04:14 -0400 Subject: First level repair for cx_Oracle 6.0 test regressions Fixed more regressions caused by cx_Oracle 6.0; at the moment, the only behavioral change for users is disconnect detection now detects for cx_Oracle.DatabaseError in addition to cx_Oracle.InterfaceError, as this behavior seems to have changed. Other issues regarding numeric precision and uncloseable connections are pending with the upstream cx_Oracle issue tracker. Change-Id: Id61f1e33b21c155a598396340dfdecd28ff4066b Fixes: #4045 --- lib/sqlalchemy/dialects/oracle/cx_oracle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py index 4e9f6314b..86562dfd0 100644 --- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py +++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py @@ -863,6 +863,7 @@ class OracleDialect_cx_oracle(OracleDialect): size, precision, scale): # convert all NUMBER with precision + positive scale to Decimal # this almost allows "native decimal" mode. + if self.supports_native_decimal and \ defaultType == cx_Oracle.NUMBER and \ precision and scale > 0: @@ -971,7 +972,8 @@ class OracleDialect_cx_oracle(OracleDialect): def is_disconnect(self, e, connection, cursor): error, = e.args - if isinstance(e, self.dbapi.InterfaceError): + if isinstance(e, ( + self.dbapi.InterfaceError, self.dbapi.DatabaseError)): return "not connected" in str(e) elif hasattr(error, 'code'): # ORA-00028: your session has been killed -- cgit v1.2.1