]> 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:05:26 +0000 (12:05 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 22 Jun 2011 16:05:26 +0000 (12:05 -0400)
    cx_oracle _Error.code to get at the code,
    [ticket:2200].

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

diff --git a/CHANGES b/CHANGES
index b227364d10c576571b3c2593c2379b965bd8f357..eb44ebee267f07f7e856751ee727be71c7362288 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -12,6 +12,11 @@ CHANGES
     after from_statement() were called.
     [ticket:2199].
 
+- oracle
+  - Added ORA-00028 to disconnect codes, use 
+    cx_oracle _Error.code to get at the code,
+    [ticket:2200].
+
 0.6.8
 =====
 - orm
index e0da995f6a8ed68c008763c1430c166a4f1dcaf1..4244d16612e035b9746ad4bdb5397084e7be143d 100644 (file)
@@ -685,10 +685,14 @@ class OracleDialect_cx_oracle(OracleDialect):
                     )
 
     def is_disconnect(self, e):
+        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.