Ok, i found the issue!
When I tried to use pg8000 to connect to postgres i got an error: cannot
insert multiple commands into a prepared statement.
Apparently multiple queries is fine with psycopg2, but not using pg8000.
We prefix all queries because of a workaround. We handle multi-tenancy
Hi Jonathan,
Thanks for your response, i removed the newresponse event like you
mentioned and added a finished callback to the request (in a tween):
request.add_finished_callback(cleanup_db_session)
Unfortunatly the plot thickens! Since the last time i tested our project,
the problem
1. I had a concern a few months ago when doing an audit of code. I ended
up not having an issue, but this link might be of help:
https://groups.google.com/d/topic/sqlalchemy/Z7tMCB_IK1M/discussion
2. I use `add_finished_callback`, which runs unconditionally at the end of
every request.