On 12/15/05, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > Currently, the core handlers (modpython.py and wsgi.py in > django/core/handlers/) wrap the main request handling in a > try/finally, where the "finally" part closes the database connection. > Obviously, this couples the handler to a database connection, which is > not ideal, because people should be able to use Django without a > database connection. > > However, if a person *does* use a database, we still want that > connection.close() in a finally. > > Elegant solutions, anybody?
Signal? When the request is done, raise an event. Have db hook that event when it's opened? Sorry, haven't looked closely...