[mod_python] Persistant data

Michael S. Fischer michael at dynamine.net
Wed Dec 17 15:21:29 EST 2003

In the interest of keeping it simple, I suggest you store your 
persistent data using anydbm and use synchronization techniques (i.e. 
rename) to ensure that two processes don't try to write to the database 
simultaneously (mid-air collision).  Other techniques just give you more 
code complexity and not much added benefit.

This is pretty much exactly what the new session code in 3.1.2b does.


Timothy Stebbing wrote:

> Is there some way to persist data resource using apache? Im writing a 
> simple protocol module
> using PythonConnectionHandler, this takes queries and runs them against 
> various backends,
> ie postgres, Lupy (indexer), etc. I want to persist my connections to 
> these resources across all
> requests.
> Ive tried adding a db 'pool' into a module, but the module is reloaded 
> for each request serviced.
> Im wondering if there is some way I can add objects into these 'apache 
> tables' ? would that make
> them persistant, and if so how do I do that? I was also wondering if I 
> could somehow access the
> main namespace from child interpreters?
> cheers
> tjs
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list