Re: [Sqlalchemy-users] problem with atexit and sqlalchemy

2006-07-23 Thread Mike Bernson
thanks for the help. Calling dispose on all engines did fix the error for me. Michael Bayer wrote: > there are many on this list who dont think very highly of global > variables ! :) > > id advise using your own create_engine function to keep track of created > engines before calling SA's create

Re: [Sqlalchemy-users] problem with atexit and sqlalchemy

2006-07-23 Thread Michael Bayer
there are many on this list who dont think very highly of global variables ! :) id advise using your own create_engine function to keep track of created engines before calling SA's create_engine strategy, and/or monkeypatch sqlalchemy.create_engine to do so: atexit_engines = []

Re: [Sqlalchemy-users] problem with atexit and sqlalchemy

2006-07-23 Thread Mike Bernson
I am using threadlocal. Is there any global name that I can call in atexit function. The atexit function is registered before any database stuff is accessed. The engine create is ' engine = create_engine(connect_string, strategy='threadlocal')'. In the atexit function I just want to close

Re: [Sqlalchemy-users] problem with atexit and sqlalchemy

2006-07-23 Thread Michael Bayer
maybe engine.dispose() to explicitly close off everything first On Jul 23, 2006, at 6:15 PM, Mike Bernson wrote: > I am using ssh to port forward the connection to the database. > > I have some code that execute before any sqlalchemy that sets up a > port forward from local host to mysql databas

[Sqlalchemy-users] problem with atexit and sqlalchemy

2006-07-23 Thread Mike Bernson
I am using ssh to port forward the connection to the database. I have some code that execute before any sqlalchemy that sets up a port forward from local host to mysql database host. In this function I do atexit to kill off the ssh that has the port forward. I get a the following error when the p