Re: [sqlalchemy] The right way to use gevent with sqlalchemy

2017-07-17 Thread Tony Wang
l after > >> its been constructed: > >> > >> self.engine.pool._use_threadlocal = True > >> > >> Never alter the value of an underscore variable in any library, the > >> underscore means "private". The effect of setting this flag after &g

Re: [sqlalchemy] The right way to use gevent with sqlalchemy

2017-07-16 Thread Mike Bayer
he flag was already set >> in any case so it isn't having any effect, but this code should be >> removed. >> >> Next, you are creating many Engine objects, one for each operation via >> insert_data() -> SqlHelper() -> create_engine(). This is an >> antipattern a

Re: [sqlalchemy] The right way to use gevent with sqlalchemy

2017-07-15 Thread Tony Wang
> in any case so it isn't having any effect, but this code should be > removed. > > Next, you are creating many Engine objects, one for each operation via > insert_data() -> SqlHelper() -> create_engine(). This is an > antipattern as there should be exactly one Engine wi

Re: [sqlalchemy] The right way to use gevent with sqlalchemy

2017-07-15 Thread Mike Bayer
rocess). same goes for the sessionmaker(). > > > More details for error > https://stackoverflow.com/questions/45113145/the-right-way-to-use-gevent-with-sqlalchemy > > > Thanks! > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > &g

[sqlalchemy] The right way to use gevent with sqlalchemy

2017-07-14 Thread Tony Wang
f62505537 More details for error https://stackoverflow.com/questions/45113145/the-right-way-to-use-gevent-with-sqlalchemy Thanks! -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete