]> 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:07:59 +0000 (10:07 -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)

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 4c89ed7355d27edb0d9ba56526e784eb94cc5012..64029a47966ff455b5880fa4f7ce300aad7be053 100644 (file)
@@ -1335,9 +1335,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