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
Is it an error or a hang or a crash?
It is a hang.
What error(s) or behavior you are seeing?
If many connections open semultaneously then await on AsyncConnection freezes forever.
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