[mod_python] For what session locking is? Do i need it while using MySQL?

Norman Tindall NormanTindall at zdisk.net
Thu Aug 10 06:23:03 EDT 2006

   Hmm. i can`t get session model in mod_python
Is it something like a pool of session or a shared object? Is potentialy any thread can
access any session and they locked in a time while thread handles

   I am writing a simple MySQL session module,
in MySQL i can set SESS_ID solumn as UNIQUE and do something like this

         c.execute("insert into sessions ...")
except MySQLdb.IntegrityError:
       #  here i catch duplicate entries

Speed is a factor so.. what would be faster.. locking
with _apache._global_lock(self._req.server, self._sid) OR
MySQLdb.IntegrityError ??

documentation has only one row about locking
"When locking is on, only one session object with a particular session id can be instantiated at a time."

Could anyone give me a simple Entity Diagramm showing relations
between  Session -  Apache threads - Random generators used in
Sessions.py (they are also pooled for the numbers of MPM?)
and also more detailed info of what happens when session lock aquired

Sorry i am a newbie in multi-thread and this mutex crap :)
Would be nice if anyone give me a link or a name of a good books in
this theme.

Best regards,
 Norman                          mailto:NormanTindall at zdisk.net

More information about the Mod_python mailing list