0.91-bugfixes: fix a problem on mod_python that could result in stale DB connections

git-svn-id: http://code.djangoproject.com/svn/django/branches/0.91-bugfixes@3725 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
James Bennett 2006-09-05 16:03:02 +00:00
parent d31e39173c
commit db2e70a74b
1 changed files with 3 additions and 4 deletions

View File

@ -141,13 +141,12 @@ class ModPythonHandler(BaseHandler):
try:
request = ModPythonRequest(req)
response = self.get_response(req.uri, request)
# Apply response middleware
for middleware_method in self._response_middleware:
response = middleware_method(request, response)
finally:
db.db.close()
# Apply response middleware
for middleware_method in self._response_middleware:
response = middleware_method(request, response)
# Convert our custom HttpResponse object back into the mod_python req.
populate_apache_request(response, req)
return 0 # mod_python.apache.OK