I tried the code in my setup.(SQLAlchemy-0.7.8-py2.6). Looks like engine did not got GCed.
*[anoop@localhost tmp]$ p engtest.py * *about to delete sn...* *about to gc.collect()...* *Traceback (most recent call last):* * File "engtest.py", line 31, in <module>* * assert engine_is_removed* *AssertionError* On Thursday, 10 January 2013 18:55:59 UTC+5:30, Anoop K wrote: > > It seems engine created using *create_engine* is not freed after cleanup > of a session. Object graph indicates that event.listen for pool is holding > reference to engine even after session is garbage collected. > *What is the right way/api to delete an engine ?* > > *UseCase* > As there are lot of databases in multiple boxes whose ip/user/password can > change I would like to destroy *session and engine* after use. Cost of > creating/closing connection can be ignored for my use case. > > > > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/RWBNo1sT1ogJ. 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.
