Re: [sqlalchemy] password rotation after engine created

2022-02-04 Thread Srinu Chp
Thank you Mike for the help. On Friday, February 4, 2022 at 1:49:45 PM UTC-8 Mike Bayer wrote: > you would most easily amend the "costly operation" part of it to cache the > result for a given period of time, so that you can get this password when > you need it from local memory. the generate

Re: [sqlalchemy] password rotation after engine created

2022-02-04 Thread Mike Bayer
you would most easily amend the "costly operation" part of it to cache the result for a given period of time, so that you can get this password when you need it from local memory. the generated password should be delivered with an approximate expiration time so that you can store it locally wi

Re: [sqlalchemy] password rotation after engine created

2022-02-04 Thread Srinu Chp
Hello Mike, Thank you very much for prompt response. yes, I tried to update password and every thing works fine but every time I need to fetch new password from secret client is costly operation. So, is there any way I can catch "ORA-01017: invalid username/password; logon denied" and try pass

Re: [sqlalchemy] password rotation after engine created

2022-02-04 Thread Mike Bayer
we have a recipe for this scheme here: https://docs.sqlalchemy.org/en/14/core/engines.html#generating-dynamic-authentication-tokens no need to connect() inside the event handler, just update the parameters with the new password. On Fri, Feb 4, 2022, at 11:14 AM, Srinu Chp wrote: > Hello Everyon

[sqlalchemy] password rotation after engine created

2022-02-04 Thread Srinu Chp
Hello Everyone, We have application, while start up we initialize prepare engine args, configure orm. Once engine created we keep in session. Recently peer team introduced password rotation and for now as work around we are manually restarting the docker container to fetch latest password from

Re: [sqlalchemy] One-to-one relationship not behaving as expected when trying to replace object

2022-02-04 Thread Mike Bayer
yes, do a flush() after removing the old object before applying the new one. On Fri, Feb 4, 2022, at 2:17 AM, Dane K Barney wrote: > Thanks for the explanation, Mike. That makes sense and now I know about this > behaviour. > > > you can get your test program to succeed by sending name=None for t

Re: [sqlalchemy] Mapping column names

2022-02-04 Thread Larry Martell
Thanks for the detailed explanation. On Thu, Feb 3, 2022 at 10:18 PM Mike Bayer wrote: > > the names of attributes on your Python class and the names of columns that > are emitted in SQL are two separate things.When you have "jobid = > Column(Integer, ...)" , that's a declarative-only forma