[mod_python] question about global_lock and global_unlock
Bram Van Steenlandt
bram at diomedia.be
Wed Jul 22 17:31:11 UTC 2015
What is the point of _apache._global_lock and _apache._global_unlock ?
I've found and SQL session online for mod_python, I'm using this with
The load function is:
_apache._global_lock(self._req.server, None, 0)
c = self._db.cursor()
WHERE %s = %s
""" % (
# txt2db keeps this safe, so that a sid
# cannot be constructed to alter the
r = c.fetchone()
_apache._global_unlock(self._req.server, None, 0)
It's unclear to me why this global lock is needed, isn't this a serious
limitation on performance ?
I would assume at least do_load can do without is as there is no real
problem when you would do this simultanious.
I would think only insert and update require a lock, even update/save
could do without one I think (insert would be dangerous as it could
create two records).
Is this indeed not needed and most likely copied from a session type
where you had to be carefull about opening the same file twice ?
Can anyone shed some light on this ?
More information about the mod_python