[mod_python] session variable value (partially) dissapearing

Martijn Moeling martijn at xs4us.nu
Fri Mar 30 08:28:30 EST 2007


Well you are welcome,

I found this mailinglist usefull especially in the beginning, but still
I see solutions/techniques I start using.

I have been Involved in opensource projects since the Linux kernel 
Had no tcp/ip stack and I contributed to that.
And one of the main things is that people should help each other.

I keep reading all posts and If I think I can help someone I will,
trying to keep the workload of Graham and Jim (and others) somewhat
lighter.

I also try to contribute by sending parts of my work to people who need
it. I am developing a application framework with a desktop in a browser,
which is way from done yet but in order to get my system working on
multiple servers (load balancing) I needed a way to store Sessions
differently so I wrote a replacement for Session.py which stores the
sessions in MySQL (using MySQLdb), unfortunately this relies to much on
3rd party software to become part of mod_python, but for the Interested
it is available as a replacement for the standard session.py

So it is useful to keep reading this mailinglist, even if you know
everything to do your project(s), and help others by sharing your
knowledge, In my eyes the only way to keep mod_python (or similar Open
Source projects) alive and kicking

So thank us by helping others, with that you free up time for the
developers and Graham can leave his laptop home next time he goes away
for the holidays (if he wishes too). But more important for you, you
keep yourself being informed end educated in the process.

Anyway thanks for at least taking the time to thank, it is appreciated.

Martijn 

-----Oorspronkelijk bericht-----
Van: mod_python-bounces at modpython.org
[mailto:mod_python-bounces at modpython.org] Namens Detmar Meurers
Verzonden: Thursday, March 29, 2007 9:03 PM
Aan: mod_python at modpython.org
Onderwerp: Re: [mod_python] session variable value (partially)
dissapearing

Dear Martijn (et al.),

I think I found what the problem was - and the loss of session data
apparently was related to properly saving it, as you and Graham had
suggested: For some of the possible paths through my code doing
partial page updates, the session did not get saved - i.e., I was
missing some req.session.save() calls in the sub-functions handling
those AJAX requests. 

Thanks for the replies - it's great to know there is a community one
can discuss such issues with!

Best,
Detmar

--
Detmar Meurers, Associate Professor, Dept. of Linguistics, OSU
201a Oxley Hall, 1712 Neil Avenue, Columbus OH 43210-1298, USA
http://ling.osu.edu/~dm/                 GnuPG key on web page


On Thu, Mar 29, 2007 at 02:12:11PM +0200, Martijn Moeling wrote:
    Are you properly saving the session at every request?
    Like:
    
    # Created session like this:
    # req.session = Session.Session(req)
    
    Req.session.save()
    
    Martijn
    
    -----Oorspronkelijk bericht-----
    Van: mod_python-bounces at modpython.org
    [mailto:mod_python-bounces at modpython.org] Namens Jim Gallacher
    Verzonden: Wednesday, March 28, 2007 3:00 AM
    Aan: Detmar Meurers
    CC: mod_python at modpython.org; Graham Dumpleton
    Onderwerp: Re: [mod_python] session variable value (partially)
    dissapearing
    
    Detmar Meurers wrote:
    > Hi Graham,
    > 
    > Thanks for the very quick reply.
    > 
    > The page showing the problem actually is using the publisher
handler
    > (so no special exception handling etc.)
    > 
    > I tried the FileSession and the problem occurs there too - and I'm
    > not doing any calling of unlock().
    > 
    > I am calling req.session.save() - one question about that though:
    > Can it possibly cause problems when calling the save() several
times
    > when handling one request?
    
    It shouldn't matter. The session store is locked so only one request
can
    
    read or write at a time. This is the case even if you have session 
    locking turned off, or unlock the session manually.
    
    Jim
    _______________________________________________
    Mod_python mailing list
    Mod_python at modpython.org
    http://mailman.modpython.org/mailman/listinfo/mod_python
_______________________________________________
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