Re: [sqlalchemy] SQLAlchemy connection errors

2014-09-13 Thread Matthijs Blaas
@Jonathan Vanasco: i have no input on the issues michael identified. but i'm curious about a sqlalchemy event somehow not firing. which transaction event were you using? after_begin or after_transaction_create ? I used the after_begin event to set the search_path, but moved it into the

[sqlalchemy] Re: SQLAlchemy connection errors

2014-09-12 Thread Matthijs Blaas
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

Re: [sqlalchemy] SQLAlchemy connection errors

2014-09-12 Thread Matthijs Blaas
set the search path within the connection pool using the “connect” event; all connections used by the pool will then have this search path setting the moment they connect. Don’t ever put multiple SQL expressions in a DBAPI execute (for this very reason - driver changes, hilarity ensues. We are

[sqlalchemy] Re: SQLAlchemy connection errors

2014-09-11 Thread Matthijs Blaas
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

[sqlalchemy] SQLAlchemy connection errors

2014-09-10 Thread Matthijs Blaas
this problem? Thanks in advance! Matthijs Blaas PS: sorry for the crosspost (http://stackoverflow.com/questions/25768428/sqlalchemy-connection-errors), i hope i might catch some experts here that otherwise wouldn't see the stackoverflow post -- You received this message because you are subscribed