[mod_python] mod_python and db connections - architectural advice needed

Christoph Pingel ch.pingel at web.de
Thu Feb 17 04:42:15 EST 2005


Hello,

I'm looking for good advice for the architecture of a web (service) 
application.

Using mod_python and psycopg, how do I *keep* a database connection 
while using and disposing of cursors? And how can I integrate the 
session handler with a (user specific) database connection?

I've got my application running, but I create and destroy db 
connections far too often. Is it, for example, good practice to pass 
a cursor into an object that abstracts the db connection details, 
rather than creating the cursor inside that abstraction and 
distroying it after every curs.execute?

I'm looking for references, hints, and especially programming examples.

TIA,
Christoph


More information about the Mod_python mailing list