Re: [sqlalchemy] do_connect listener called couple of times

2022-03-21 Thread Simon King
As suggested here: https://docs.sqlalchemy.org/en/14/core/engines.html#fully-replacing-the-dbapi-connect-function In your do_connect handler, rather than calling engine.connect(), you need to call cx_Oracle.connect(), and return the result. You can wrap this in an exception handler that detects

Re: [sqlalchemy] do_connect listener called couple of times

2022-03-21 Thread Srinu Chp
Hello Simon, Thank you for prompt response. I really appreciate your help. I am trying to achieve password rotation and we are using secret client to fetch new password. I tried do_connect event and fetch new password from secret client, working as expected but we are facing performance issue

Re: [sqlalchemy] do_connect listener called couple of times

2022-03-21 Thread Simon King
I don't really understand what's going on in your code, but you seem to be calling engine.connect() inside your "do_connect" event handler. I would expect that to trigger another "do_connect" event, which in turn will call engine.connect() again, which will trigger another "do_connect" event, and