[mod_python] sharing stuff between multiple apache processes

Julien Cigar jcigar at ulb.ac.be
Tue Aug 8 06:07:25 EDT 2006

Hello list,

I'm using SQLAlchemy with apache/mod_python (prefork) and a custom 
mod_python handler. I was looking for a solution to share the SQLAlchemy session 
object between the apache processes.

The SQLAlchemy session is almost the same as a session in Hibernate.

At the moment I have a session object per process (which work fine), but 
I have to close / reopen the session object for each request which is 
not optimal ... and can cause a lot of problems if I forget to close the 
session at the end of a request, for example if I modify an object in 
the session of a process which is still persistent (cached) in the 
session of another process, etc ...

I plan to use either shared memory (no experience with this at the 
moment) or memcached which look nice. Do you have any suggestion or 
another solution for this ? 
Is there something in mod_python to share an object between processes ?


Julien Cigar
Belgian Biodiversity Platform
Université Libre de Bruxelles
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
office: jcigar at ulb.ac.be
home: mage at mordor.ath.cx

More information about the Mod_python mailing list