[mod_python] MySQL connections not closing properly

Andres Morey amorey at octopart.com
Fri May 25 16:27:19 EDT 2007


I am using mod_python 3.3.1 with Python 2.5, Apache 2.2.4, MySQL  
5.0.27 and MySQLdb 1.2.2. When I stop the server I get "Aborted  
connection" warnings in MySQL even though I am closing the database  
connections properly when an object goes out of scope (by using the  
__del__ method). These warnings only happen when a python instance  
with an open database connection is killed abruptly, so I think it  
has something to do with the way that mod_python shuts down the  
python interpreter.

How does mod_python shut down the python interpreter? Is there a good  
way to handle when mod_python shuts down the python interpreter?


More information about the Mod_python mailing list