the connection is returned relative to the mapper given, since there can be more than one engine in use:
conn = session.connection(<mapper>) although if the Session is bound to an engine which you want to use, which is probably what you want, then you can just say: conn = session.connection(None) I may make the argument optional soon, so it would just be session.connection(). then with the connection you can just execute things: result = conn.execute(sometable.select(), **params) On Jul 13, 2006, at 12:43 PM, Randall Smith wrote: > I'm running in a mixed environment of SQLA/non-SQLA database code. > During a session, I need to run some queries on tables not represented > by SQLA classes and would like to run them in the same transaction > (assuming a session is handled in a transaction) to take advantage of > Postgresql's MVCC. So how do I get at the current connection given an > object that was obtained from a session like so. > > obj = session.query(SQLAClass).select()[0] > > Randall > > > > ---------------------------------------------------------------------- > --- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Sqlalchemy-users mailing list > Sqlalchemy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users