[mod_python] Multiple call to Session.Session(req) problem

Terry Macdonald terry.macdonald at dsl.pipex.com
Fri Oct 13 11:23:49 EDT 2006

Alex Greif wrote:
> Hi,
> I have the problem that getting the session instance in a handler more
> than once makes the server hang on the second access to the session.
> the problem does ot occure on windows XP but on suse Linux with 3.2.10
> Here is my scenario:
> def view_ticket_detail(req, ticketId):
>    def __access__(req, user):
>        ...
>        # webutil.authorize will get the session
>        return webutil.authorize(req=req, login=user, 
> neededRole=neededRole)
>    req.content_type = "text/html"
>    ...
>    # now I need the session again
>    session = Session.MemorySession(req) ###### <-- here the server hangs
> any ideas?
'll assume your webutil.authorize function accesses Session, in doing so 
implicitly locking it but does not unlock it thereby causing your second 
call to Session, which wants to lock it also, to wait until the session 
object is unlocked resulting in what appears to be a hanging state.

More information about the Mod_python mailing list