Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Intermittent connectivity issue from oracledb python client to ATP oracle cloud database.

kaif KhanJul 16 2024

I am trying to connect from a Python client, but seeing this error intermittently
(oracledb.exceptions.DatabaseError) DPY-4011: the database or network closed the connection

Code that I am using:

from sqlalchemy import create_engine
import sys
oracledb.version = "8.3.0"
sys.modules["cx_Oracle"] = oracledb

engine = create_engine(
f'oracle://:@',
connect_args={
"user": username,
"password": password,
"host": host,
"port": port,
"service_name": service_name,
"protocol": "tcps",
})
engine.connect()

Comments
Post Details
Added on Jul 16 2024
0 comments
538 views