]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Added ORA-00028 to disconnect codes, use
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 22 Jun 2011 16:02:48 +0000 (12:02 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 22 Jun 2011 16:02:48 +0000 (12:02 -0400)
    cx_oracle _Error.code to get at the code,
    [ticket:2200].  Also in 0.6.9.

CHANGES
lib/sqlalchemy/dialects/oracle/cx_oracle.py

diff --git a/CHANGES b/CHANGES
index e6ae6f1310fdb7f496905a32b780301e63e81b16..d8f71bbaee66cc18cc1f33fab0344dc061385cd9 100644 (file)
--- 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,
index a917aac021178a415ffb487bd014400184286246..4f0cdffcfc15b87f321ad218e97d49ac81c76ccd 100644 (file)
@@ -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.