-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for MySQL connection recycling #239
Comments
Now that I think of it, this issue maybe more appropriate for flask-peewee, but I am not sure. |
I'm a little unclear on how your particular issue is arising. If you're using flask-peewee's |
Yes, we are using gunicorn with multiple workers and without threadlocals=True. Must have missed it in the docs (now I even found another old issue regarding this)! I guess that his issue is invalid then, but I will test first. |
You could use |
@arnuschky let me know if |
It seems to resolve the problem. Thanks! |
read peewee doc again, use mysql_db.connect() & mysql_db.close() for each request in CherryPy. |
You can also check out http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#pool for connection pooling and recycling. |
Thanks for your big help. |
I use peewee with flask. Peewee database connection :
After mysql error that "MySQL server has gone away (error(32, 'Broken pipe'))", select queries works without problem, but insert,update,delete queries don't work. On insert,update,delete queries works behind(in mysql) but peewee throw this errors.
|
That's odd, not sure what that might mean. |
@coleifer I have two different applications with peewee and flask. They have same problem. Select queries has no problem but insert,update,delete always throws error which above. I will do test with an basic peewee and flask app and I will write the result of the test. |
We're getting the following error on our flask project:
This problem was implicitly mentioned in #222 for example.
SQLalchemy addresses the problem as follows: pallets-eco/flask-sqlalchemy@05c5193
Associated issue: pallets-eco/flask-sqlalchemy#2
Would it be possible to implement this in PeeWee as well?
The text was updated successfully, but these errors were encountered: