Create connection without pool
It it possible to use cx_Oracle_async without oracle pool and threads?
It was not designed with a direct connection mode, which may be a result of design oversight on my part, as I believe there is no proper scenario for single connection at that time. Improvements are welcomed with pull request!
There is a scenario when you need async connections in SYS_DBA mode which is supported only for single connections, not for pools.
i need to wrap all my db objects so that they maintain the same interfaces ie db.exec("select..."). it seems to work just doing something like:
connection = await cx_Oracle_async.create_pool(
user=self.username,
password=self.password,
dsn=self.dsn,
)
conn = await connection.acquire()
cursor = await conn.cursor()
cursor.execute("SELECT...")
records = cursor.fetchall()
await connection.close(force=True)
connection = None
cursor = None
@GoodManWEN is there any reason to not use it like this?