Skip to content
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

Failed SQLA operations don't roll back in dashboard, block threads #142

Open
joefutrelle opened this issue Jun 3, 2016 · 3 comments
Open

Comments

@joefutrelle
Copy link
Owner

A teardown handler can be used to roll back the transaction and release the connection. It still will not reattempt the transaction, and the web request will still fail, but that is better than leaving the connection blocked.

http://stackoverflow.com/questions/33284334/how-to-make-flask-sqlalchemy-automatically-rollback-the-session-if-an-exception

http://stackoverflow.com/questions/21078696/why-is-my-scoped-session-raising-an-attributeerror-session-object-has-no-attr

@joefutrelle
Copy link
Owner Author

Probably need a teardown on the workflow web service as well.

@joefutrelle
Copy link
Owner Author

Weirdly, adding a teardown on the workflow webapi blueprint causes it to not work at all, so I may not be doing that right.

@joefutrelle
Copy link
Owner Author

This has to do with session management. Normally in this situation people use Flask-SQLAlchemy to automatically set the scoped_session sesssion scope to per-request; I was doing it globally.

If you're not using Flask-SQLAlchemy to do this you have to do it yourself

http://stackcode.xyz/sc?id=is37844704

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant