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

2014-11-11 Thread Chris Withers
On 07/11/2014 21:30, Michael Bayer wrote: So, turns out the pandas.io.sql.read_frame in the version of pandas I'm using has a con.commit() in it. wtf?! Guess I'll raise that as a bug in Pandas if they haven't fixed it in a subsequent release… didn’t pandas introduce SQLAlchemy

[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

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:

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