That probably isn't too far off.  One time it did work and it was
weird so I might have actually got one of the threads to fire
correctly.  Is there a way to limit the amount of threads mod_python
uses?

Seth

On Mar 1, 9:48 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> Hi Seth,
>
>
>
> On Fri, 2007-03-02 at 03:35 +0000, Seth Buntin wrote:
> > I have this:
>
> > request.session["order_items"] = []
>
> > and on certain views I have:
>
> > request.session["order_items"].append(order_item.id)
>
> > In development mode this works fine.  Even when I use Firebug I see
> > everything being sent to the specific views and other areas of the
> > site are being updated correctly (they don't rely on the session
> > variable) and are receiving the variables I send via AJAX.  It is
> > acting like the session variable is just being passed over.  Kinda
> > like the session isn't being saved but I have
> > SESSION_SAVE_EVERY_REQUEST = True in my settings file.'
>
> Thanks for the extra information. Makes things a little clearer.
>
> Slight stab in the dark here, but whilst I think about it some more,
> this may provide some clues for you to think about: one difference
> between the development environment and mod_python is threadedness. In
> the dev environment, everything is being run in a single thread, one
> step at a time. In the mod_python setup, different threads could be
> handling different portions of your processing each time.
>
> I'm wondering if this may lead to race conditions along the lines of:
>
>         thread A creates a session
>
>                         thread B creates a session
>
>         thread A stores "foo = 6" in session
>
>                         thread B stores "blah = 1" in its session
>
>         thread A stores session (which contains foo=6)
>
>                         thread B stores session (which does NOT have foo=6)
>
> might be happening if you are doing lots of partial updates.
>
> Like I said, this is just a gut feeling of something to look at based on
> one known difference between the two environments. Working out whether
> I'm on crack or not may require rummaging through to code to work out
> exactly who is saving what when. In the meantime, I'll let it bounce
> around in my head a bit and see if anything else pops into mind.
>
> Regards,
> Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to