[mod_python] mysql_python connections

Trevor West trevorw at qalabs.com
Wed Nov 24 18:00:06 EST 2004

I'm creating a python web-app using MySQL and mod_python. I'm running 
into a problem where database connections are staying open even if I 
close them. I'm opening a database connection on each page, but close it 
as soon as I'm done all that I want to do. I was wondering if my 
connection was staying active because of threads.

When I log into my application then log out again there are 3 more MySQL 
processes running when I check "ps -ef | grep mysql " then there were 
before. Does anyone have any good ways to connect to the mysql database 
on a python website, or should I continue to connect on everypage, and 
if so, do I specifically have to make it thread safe (I don't have much 
experience with threads, but I'll do it if that's the problem).

Thanks for the help.



More information about the Mod_python mailing list