A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/oracle/python-oracledb/issues/353 below:

Concurrent open of connections don't work on 2.2.0 and 2.2.1 also (operation takes forever) · Issue #353 · oracle/python-oracledb · GitHub

Skip to content Navigation Menu

Saved searches Use saved searches to filter your results more quickly

Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert Additional navigation options

Concurrent open of connections don't work on 2.2.0 and 2.2.1 also (operation takes forever) #353

Description
  1. What versions are you using?

Oracle Database 19c

platform.platform: Windows-10-10.0.19045-SP0
sys.maxsize > 2**32: True
platform.python_version: 3.12.3

oracledb.version: 2.2.0

  1. Is it an error or a hang or a crash?
    It is a hang.

  2. What error(s) or behavior you are seeing?

If many connections open semultaneously then await on AsyncConnection freezes forever.

  1. Does your application call init_oracle_client()?
    No, it's Thin mode.
  1. Include a runnable Python script that shows the problem.
import oracledb
import asyncio

oracledb.defaults.config_dir = ' '
u = ' '
p = ' '

async def c(u, p, dsn):
    print('start')
    connection = await oracledb.connect_async(user=u,
                                              password=p,
                                              dsn=dsn)
    print('end')


async def main():
    asyncio.create_task(c(u, p, ' '))
    asyncio.create_task(c(u, p, ' '))
    await asyncio.sleep(3)

if __name__ ==  '__main__':
    asyncio.run(main())

Addition of Async.Lock synchronization solves the problem.

import oracledb
import asyncio

oracledb.defaults.config_dir = ' '
u = ' '
p = ' '

async def c(u, p, dsn, l):
    print('start')
    async with l:
        connection = await oracledb.connect_async(user=u,
                                                  password=p,
                                                  dsn=dsn)
    print('end')


async def main():
    l = asyncio.Lock()
    asyncio.create_task(c(u, p, ' ', l))
    asyncio.create_task(c(u, p, ' ', l))
    await asyncio.sleep(3)

if __name__ ==  '__main__':
    asyncio.run(main())

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4