[sqlalchemy] Re: [Proposal] Some simple high-level feature to set connection timeouts

2022-01-10 Thread Don Nillo
Yup. Sure. I meant "query timeouts", not "connection timeouts". May be a good option could be like this: connection.execute(stmt, timeout=MAX_TIME) Anyway, thanks. (Admins, please, feel free to delete this conversation. I'm ashamed for not using search properly. Sorry for that) On Monday,

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,

[sqlalchemy] Re: [Proposal] Some simple high-level feature to set connection timeouts

2022-01-10 Thread Jonathan Vanasco
SQLAlchemy supports connection timeouts to establish a connection already. SQLAlchemy does not, and can not, support query timeouts. This is possible with some python database drivers, but very rare. In every Python database program/library query timeouts are typically handled on the database

[sqlalchemy] RE: builtins.NoneType' is not mapped

2022-01-10 Thread Clive Swan
Greetings, I am getting the following error, any suggestions would be welcomed. When running: deleteVersionStamp self.session.delete(rec) File “\Externals\win32\Lib\site-packages\sqlalchemy\orm\scoping.py”, line 162, in do return getattr(self.registry(), name)(*args, **kwargs)

[sqlalchemy] Re: [Proposal] Some simple high-level feature to set connection timeouts

2022-01-10 Thread Don Nillo
UPD: found out cx_Oracle also has Connection.cancel() method. May be things are not that bad On Monday, January 10, 2022 at 12:52:49 PM UTC+3 Don Nillo wrote: > Hi! > Sorry for bothering, I have not enough skills to contribute yet ( > But... > I think it would be great to have some feature to

[sqlalchemy] Re: Create association of three or more tables

2022-01-10 Thread fco...@gmail.com
Hi, A colleague helped me to write the relationship() part, the working code with relationships is now : class UserOrgRole(Base): __tablename__ = "user_org_role" user_id = Column(ForeignKey("user.id", ondelete="CASCADE"), primary_key=True ) org_id = Column(ForeignKey("org.id",