[sqlalchemy] manual connection management interacting badly with sessions

2014-11-07 Thread Chris Withers
Hello, So, short version: if I need a raw DBAPI connection and I have a SQLAlchemy Session, what's the correct way to manage that raw connection if I get it using session.connection().connection? Versions: Postgres 9.2 SQLAlchemy 0.8.2 Background: I want to create a DataFrame using

[sqlalchemy] SQLAlchemy redis mysql, max_user_connection

2014-11-07 Thread Enrico Bottani
Hello everybody, I'm developing a web service and I'm using SQLAlchemy as an ORM backed by MySql, I'm using flask to handle web requests, and redis-rq as queue system. Most of my service is about reading data from db so performance is fairly good. Now I'm adding a feature where I would like

Re: [sqlalchemy] SQLAlchemy redis mysql, max_user_connection

2014-11-07 Thread Michael Bayer
On Nov 7, 2014, at 5:56 AM, Enrico Bottani bei...@mac.com wrote: Hello everybody, I'm developing a web service and I'm using SQLAlchemy as an ORM backed by MySql, I'm using flask to handle web requests, and redis-rq as queue system. Most of my service is about reading data from db so

Re: [sqlalchemy] manual connection management interacting badly with sessions

2014-11-07 Thread Michael Bayer
On Nov 7, 2014, at 5:06 AM, Chris Withers ch...@simplistix.co.uk wrote: Hello, So, short version: if I need a raw DBAPI connection and I have a SQLAlchemy Session, what's the correct way to manage that raw connection if I get it using session.connection().connection? Versions:

[sqlalchemy] Re: SQLAlchemy redis mysql, max_user_connection

2014-11-07 Thread Jonathan Vanasco
In addition to what Mike said... My guess is that you probably have an issue with rq. I had run into issues with celery (similar) where I spawned too many background processes. Any given web request required 2 database connections -- one for the web request, and a second one in the celery

[sqlalchemy] [Sqlachemy Core] Help on joining 3 tables

2014-11-07 Thread Tiago Guimarães
Hi. Could anyone help me with translating the following SQL to Sqlalchemy Core? SELECT A.id, B.id, C.id FROM A LEFT OUTER JOIN B ON B.some_col = A.some_col LEFT OUTER JOIN C ON C.other_col = A.other_col The problem I'm facing is that the *Select().select_from(fromclause*)

Re: [sqlalchemy] manual connection management interacting badly with sessions

2014-11-07 Thread Chris Withers
On 07/11/2014 14:14, Michael Bayer wrote: session.connection().connection is the same connection that session.rollback() will be referring towards. though when you have that DBAPI connection (it is in fact still wrapped by ConnectionFairy), you shouldn’t call commit() or rollback() on that

Re: [sqlalchemy] manual connection management interacting badly with sessions

2014-11-07 Thread Michael Bayer
On Nov 7, 2014, at 2:02 PM, Chris Withers ch...@simplistix.co.uk wrote: On 07/11/2014 14:14, Michael Bayer wrote: session.connection().connection is the same connection that session.rollback() will be referring towards. though when you have that DBAPI connection (it is in fact still