Closed Ashok-Bottu closed 1 year ago
Include a runnable Python script that shows the problem.
Please provide such a script. A small script. Is some timeout like a firewall killing all your connections?
This issue has been automatically marked as inactive because it has not been updated recently. It will be closed if no further activity occurs. Thank you for your contributions.
Closing - no activity.
Is it an error or a hang or a crash? Issue: Back-end service sometimes executes in ~2secs(end to end) and same service few times performs with ~12secs. Upon application loggers, understood that db connection acquiring is actually taking time at times.
It has been noted from v$session that, dedicated pool sessions are created again and again for each connection query execution.
What error(s) or behavior you are seeing? Noted Pattern:
with the above behavior, the initially created sessions are auto-cleaned up and new sessions are getting created for every backend service execution.
apps.py pool = cx_Oracle.SessionPool(user=os.environ.get("DB_USER"), password=os.environ.get("DB_PWD"), dsn=dsn, min=5, max=10, encoding="UTF-8" )
db_manager.py: class Connection: def init(self): self.connection = pool.acquire() def exit(self, cur_coll=None, *args, **kwargs): pool.release(self.connection)
sample_service.py def api_get_data(request): with Connection() as connection:
please let me know, if need more details here.