The major release of cx_Oracle after 8.3 was renamed python-oracledb. Until
SQLAlchemy natively supports this namespace, to use python-oracledb instead of
cx_Oracle, user applications can add these lines in the first executed file:
import sys
import oracledb
oracledb.version = "8.3.0"
sys.modules["cx_Oracle"] = oracledb
This commit checks the new dead-connection error numbers that python-oracledb
generates.
# 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