> [mailto:[EMAIL PROTECTED] On Behalf Of Michael Bayer > Theres some things you're doing that would specifically cause > you to get back a different connection than the one you > created the function on, even within a single thread; except > that the SQLite dialect uses the SingletonThreadPool pool by > default which does in fact nail a single connection to each > thread. Seems like you've either changed that setting or you <...> > Calling session.bind.connect() in the general case gives you > a connection unrelated to the one used when you call > Session.execute(). > If you'd like the connection that the Session is actually > using, the Session must be within a transaction (via > transactional=True or via > begin()), then call Session.connection(). If the Session is > not in a > transaction, Session.connection() again calls an arbitrary > connection from the pool.
Thanks a lot for the information. I'm creating my session class like so: SessionClass = scoped_session(sessionmaker(bind=engine, autoflush=True, transactional=True)) I'm closing out each "exposed" method call with a "self.session.close()" If I start my method calls with "begin()" would I be able to create functions in the connection object, then use my session object to run queries? Regards, Ryan Ginstrom --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
