the QueuePool uses __del__ to close connections when its garbage disposed. because python tears down modules in a somewhat unpredictable way, the __del__ method fails when you shut the application down because the Queue module on which it depends has already been torn down.
anyway, __del__ exceptions are ignored by the python interpreter so the issue in this case is only cosmetic. this step has been removed in rev 1859. On Sep 10, 2006, at 3:04 PM, Valentin Kuznetsov wrote: > Hi, > I switch using explicit connection, but now when I shutdown my > application I got the following exception: > > Exception exceptions.AttributeError: "'NoneType' object has no > attribute 'Empty'" in <bound method QueuePool.__del__ of > <sqlalchemy.pool.QueuePool object at 0xb6f5a42c>> ignored > > This never happened before and I don't know what should I do about > it. It happens when I send Ctrl-C signal to my app. > > I think I need to give more details how I'm using SQLalchemy objects. > First, I auto-load tables with > meta = DynamicMetaData() > meta.connect(engine1) > t = Table(t,meta,autoload=True) > > then, I made connection > con = engine.connect() > con.execute(...) > con.close() > > where I switch my engines every time based on user request. > Everything looks working fine except the exception shown above on app > interruption. Please note that I autoload tables > only from one particular engine and use then for all other engines I > connect to. > > Thanks. > Valentin. > > On Sep 8, 2006, at 8:52 PM, Michael Bayer wrote: > >> >> SQLALchemy supports dealing with explicit Connection objects as an >> alternative to BoundMetaData or DynamicMetaData. that way you could >> access each database in a more explicit way, if desired: >> >> connection1.execute(tablea.select()) >> >> connection2.execute(tablea.select()) >> >> this is also supported by the Session using the bind_to keyword >> argument >> and bind() methods. >> >> with the DynamicMetaData, yeah youd have to switch it around for each >> database when you want to switch. >> >> >> Valentin Kuznetsov wrote: >>> Hi, >>> I have several DBs whose schema identical. I found that I can use >>> meta = DynamicMetaData() >>> meta.connect(engine1) >>> meta.connect(engine2) >>> >>> I know how to upload all tables and keep them in local cache. What I >>> don't understand is >>> how to access given table from different DBs. For instance, both DBs >>> has table A. >>> If I'd like to use table_A from engine1, do I need to connect first >>> to that engine? >>> And right after that if I want to use table_A from engine2, do I >>> need >>> to connect >>> to engine2? >>> How to drop connections? Can I cache connections? >>> >>> Thanks, >>> Valentin. >>> >>> >>> >>> -------------------------------------------------------------------- >>> - >>> ---- >>> 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 ------------------------------------------------------------------------- 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