what kind of pooling are you using? normally connect() should return a new connection independent of any other. Only the StaticPool and the SingletonThreadPool, both very special use pools, have any notion of sharing the same connection for multiple connect() calls (or if you're using the ThreadLocal engine, which is highly unusual). These pools are never used by default unless you use a SQLite :memory: engine in which case it uses SingletonThreadPool.
The rationale for the call is so that elements which are initialized the first time the Engine connects, such as "default_schema_name", are available. The call could be conditionalized. On Jun 27, 2013, at 3:05 PM, Ryan Kelly <[email protected]> wrote: > Attempting to use Inspector.from_engine to get a list a table names from > the database. Running the test suite of a large program I found that my > data would disappear. After digging around in my own code for a few > hours trying to find the problem, I tracked it down to the call to > Inspector.from_engine, and inside I see this: > > if self.engine is bind: > # if engine, ensure initialized > bind.connect().close() > > It seems to be the cause of the ROLLBACK. > > I'm not sure why this is necessary. Thoughts? > > -Ryan > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/groups/opt_out.
