]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Handle dead-connection errors for users of python-oracledb
authorChristopher Jones <christopher.jones@oracle.com>
Tue, 31 May 2022 12:27:18 +0000 (08:27 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 May 2022 14:08:42 +0000 (10:08 -0400)
Added two new error codes for Oracle disconnect handling to support early
testing of the new "python-oracledb" driver released by Oracle.

Fixes: #8066
Closes: #8065
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8065
Pull-request-sha: d630b8457a1d29b7a1354ccc6d5e2956eea865f6

Change-Id: Ib14dbb888597b1087b1bb7c505ccad59df226177
(cherry picked from commit 2bf00472bfafd8fd0cca5b4fe55ff4faf1a1279e)
(cherry picked from commit 8564e2abf97795819f655a70b19b3bc820729c79)

doc/build/changelog/unreleased_14/8066.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/oracle/cx_oracle.py

diff --git a/doc/build/changelog/unreleased_14/8066.rst b/doc/build/changelog/unreleased_14/8066.rst
new file mode 100644 (file)
index 0000000..5f814ab
--- /dev/null
@@ -0,0 +1,6 @@
+.. change::
+    :tags: usecase, oracle
+    :tickets: 8066
+
+    Added two new error codes for Oracle disconnect handling to support early
+    testing of the new "python-oracledb" driver released by Oracle.
index c88feae1a73479ca23ae7ea142cd0dba1350f10a..290789f3213ae0c881209fe643ec83413b109217 100644 (file)
@@ -1249,9 +1249,12 @@ class OracleDialect_cx_oracle(OracleDialect):
             # TODO: Others ?
             return True
 
-        if re.match(r"^(?:DPI-1010|DPI-1080)", str(e)):
+        if re.match(r"^(?:DPI-1010|DPI-1080|DPY-1001|DPY-4011)", str(e)):
             # DPI-1010: not connected
             # DPI-1080: connection was closed by ORA-3113
+            # python-oracledb's DPY-1001: not connected to database
+            # python-oracledb's DPY-4011: the database or network closed the
+            # connection
             # TODO: others?
             return True