Re: [sqlalchemy] Thread Safety

2020-07-21 Thread Mike Bayer
On Mon, Jul 20, 2020, at 7:55 PM, Praveen Kumar wrote: > > Confirming some details re: thread safety ( I noticed older posts in this > group on the topic... but they're quite old ) -- > > I'm using version 1.2.7, and can't upgrade. I understand that Connection and > Transaction are not

[sqlalchemy] Thread Safety

2020-07-20 Thread Praveen Kumar
Confirming some details re: thread safety ( I noticed older posts in this group on the topic... but they're quite old ) -- I'm using version 1.2.7, and can't upgrade. I understand that Connection and Transaction are not threadsafe. Are Engine and QueuePool ( the default pool ) threadsafe ?

Re: [sqlalchemy] Thread safety in LazyLoader._emit_lazyload

2019-02-19 Thread Mike Bayer
here is your patch: diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py index 3e7372fac7..ec3c9790f2 100644 --- a/lib/sqlalchemy/orm/strategies.py +++ b/lib/sqlalchemy/orm/strategies.py @@ -595,6 +595,9 @@ class LazyLoader(AbstractRelationshipLoader,

Re: [sqlalchemy] Thread safety in LazyLoader._emit_lazyload

2019-02-19 Thread Mike Bayer
that was actually quite easy! https://github.com/sqlalchemy/sqlalchemy/issues/4507 On Tue, Feb 19, 2019 at 7:18 PM Mike Bayer wrote: > > this will be moving to a github issue, and also I will attempt to > create a proof of concept. > > Everything that happens inside of

Re: [sqlalchemy] Thread safety in LazyLoader._emit_lazyload

2019-02-19 Thread Mike Bayer
this will be moving to a github issue, and also I will attempt to create a proof of concept. Everything that happens inside of _memoized_attr__simple_lazy_clause involves creating copies of things and the state of the loader strategy is not modified until it's done. There is one "unique=False"

[sqlalchemy] Thread safety in LazyLoader._emit_lazyload

2019-02-19 Thread Krzysztof Sulejczak
Hi, I'm maintaining a multi-threaded application which uses sqlalchemy to access mysql db. Some time ago we decided to upgrade sqlalchemy version from 1.1.18 to 1.2.14 and since then we started observing strange problems, the application started throwing IntegrityError in code like that:

[sqlalchemy] thread-safety of Session, Engine, and Connections

2015-08-16 Thread Jinghui Niu
For clarity I made a table below in my notes out of reading the documentation and generalize the points: Engine: no worries, Engine object is always thread safe. Session: Session objects are tricky, they can be quite dangerous to use in a multi-threading context if one is not careful. Forget

[sqlalchemy] Thread safety - is it safe to use the core in a web application?

2015-03-31 Thread Duke Dougal
I am using the Falcon web server and SqlAlchemy core. I have read warnings about it not being thread safe. I'm not sure what the implications are of this. Will there be a problem or can I code around it somehow? I'm trying to avoid the ORM for now - at least until I have some grasp of what

Re: [sqlalchemy] Thread safety - is it safe to use the core in a web application?

2015-03-31 Thread Michael Bayer
Duke Dougal dukedou...@gmail.com wrote: I am using the Falcon web server and SqlAlchemy core. I have read warnings about it not being thread safe. I'm not sure what the implications are of this. Will there be a problem or can I code around it somehow? I'm trying to avoid the ORM