[mod_python] persistence in mod_python

Simon Bierbaum bierbaum at vierfalt.com
Wed Aug 20 13:40:17 EDT 2008


Hi all,

I would like to know exactly what bits in mod_python are persistent  
across multiple requests to the same apache process. I.e., once  
apache is started and mod_python is loaded, between two requests  
served by the same apache process and the same Python handler,

- does mod_python reload modules, i.e. is module initialization code  
only run once during the apache process lifespan?
- is there a way for modules to store objects persistently, e.g. a  
database connection pool?
- what happens to variables defined in the handler script but not  
locally within the handler() function (I'm not sure whether this is  
what Python calls "global")?

I have a bug in my application which uses mod_python, MySQLdb and the  
InnoDB storage engine revolving around transactions, and it's driving  
me mad...any help or a pointer to documentation is greatly appreciated.

Thanks, Simon


More information about the Mod_python mailing list