Re: [sqlalchemy] Turn off connections invalidation functionality

2022-01-11 Thread Anupama Goparaju
cx-oracle SessionPool is used underlying that will probe connections on checkout and recover. Hence, trying to disable SQLAlchemy invalidate pool. Thanks! On Monday, January 10, 2022 at 12:04:57 PM UTC-8 Mike Bayer wrote: > > > On Mon, Jan 10, 2022, at 1:30 PM, Anupama Goparaju wrote: > >

Re: [sqlalchemy] Turn off connections invalidation functionality

2022-01-10 Thread Mike Bayer
On Mon, Jan 10, 2022, at 1:30 PM, Anupama Goparaju wrote: > Thanks. Looks like this works but we need to set it for every exception > scenario. Just confirming if the exception_context is thread safe to set the > attribute. yes this all happens local to the execute() function call, is not

Re: [sqlalchemy] Turn off connections invalidation functionality

2022-01-10 Thread Anupama Goparaju
Thanks. Looks like this works but we need to set it for every exception scenario. Just confirming if the exception_context is thread safe to set the attribute. Also, does this setting prevent pool invalidation on all sort of exceptions related to connections? @event.listens_for(Engine,

Re: [sqlalchemy] Turn off connections invalidation functionality

2022-01-06 Thread Anupama Goparaju
Thanks, i will give it a try. On Thursday, January 6, 2022 at 5:23:09 AM UTC-8 Mike Bayer wrote: > I can't guarantee that overriding private methods is safe, no. > > there's a public API to disable errors resulting in invalidation, I > suggest you use that. > > > > On Wed, Jan 5, 2022, at 7:35

Re: [sqlalchemy] Turn off connections invalidation functionality

2022-01-06 Thread Mike Bayer
I can't guarantee that overriding private methods is safe, no. there's a public API to disable errors resulting in invalidation, I suggest you use that. On Wed, Jan 5, 2022, at 7:35 PM, Anupama Goparaju wrote: > I haven't read the response before and tried to skip the lib logic by >

Re: [sqlalchemy] Turn off connections invalidation functionality

2022-01-05 Thread Anupama Goparaju
I haven't read the response before and tried to skip the lib logic by overriding the function below in my child call extending the NullPool to do nothing. Is this safe to do? def _invalidate(self, connection, exception=None, _checkin=True): pass On Wednesday, January 5, 2022 at 4:33:01

Re: [sqlalchemy] Turn off connections invalidation functionality

2022-01-05 Thread Anupama Goparaju
Great, thanks for the info. On Friday, November 26, 2021 at 9:30:02 AM UTC-8 Mike Bayer wrote: > I've spent some time thinking about what might be being asked here.the > only thing I can think of is that when a particular database connection is > found to be in what we call a "disconnect"

Re: [sqlalchemy] Turn off connections invalidation functionality

2021-11-26 Thread Mike Bayer
I've spent some time thinking about what might be being asked here.the only thing I can think of is that when a particular database connection is found to be in what we call a "disconnect" state, the connection is invalidated, so that the connection will reconnect and make a new connection.

Re: [sqlalchemy] Turn off connections invalidation functionality

2021-11-26 Thread Mike Bayer
Im not sure if I understand the question? if you don't call .invalidate(), then the connection is not invalidated. what does "turn off" mean ? On Fri, Nov 26, 2021, at 11:17 AM, Anupama Goparaju wrote: > Hi, > > Is there a way to safely turn off connection invalidation functionality >

[sqlalchemy] Turn off connections invalidation functionality

2021-11-26 Thread Anupama Goparaju
Hi, Is there a way to safely turn off connection invalidation functionality (based on invalidation time set, all the connections created prior to the timestamp are invalidated) in sqlalchemy? https://github.com/Noethys/Connecthys/blob/master/connecthys/lib/sqlalchemy/pool.py#L574 Thanks,