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

2017-07-17 Thread Tony Wang
Hi Mike Great thanks, error seems gone. On Sun, Jul 16, 2017 at 11:37 PM Mike Bayer wrote: > it means like this (here, I adapt your SqlHelper into a recipe that is > basically equivalent to the context manager at > >

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

2017-07-16 Thread Mike Bayer
it means like this (here, I adapt your SqlHelper into a recipe that is basically equivalent to the context manager at http://docs.sqlalchemy.org/en/latest/orm/session_basics.html#when-do-i-construct-a-session-when-do-i-commit-it-and-when-do-i-close-it) engine = create_engine(...) sessionmaker =

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

2017-07-15 Thread Tony Wang
Hi Mike Thanks very much for your detailed reply. Very kind of you. For "threadlocal" strategy, I used without it for a long time but always coming with "Runtime Error" that posted in BitBucket. I found some guys in Gevent Group

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

2017-07-15 Thread Mike Bayer
On Fri, Jul 14, 2017 at 8:08 PM, Tony Wang wrote: > I simplify a complex system of gevent with sqlachemy to a simple demo code. > > > Before using of sqlachemy, pymysql is my best choice for communication > between MySql and gevent because of its easy and direct usage.