[Zope] dict

Johan Carlsson johanc at easypublisher.com
Mon Aug 30 13:08:31 EDT 2004


Vahur Rebas wrote:

 > Hi,
 >
 > I was doing some dict modifing like testvar = 
{'test1':{'test2':'test2value'}}
 > so, everything was nice until I hit my browsers refresh button as fast
 > as I could and my little method which did some
 > if not testvar.has_key('test1')
 > wrote my default values to my testvar
 > tried setting self._p_changed = 1
 > but after some time(usually sooner) my values disapear and after zope 
restart they even don't exist anymore :(
 > Tried PersistentMapping, that also didn't help much :(


What probably happens is that when you stress the server the
REQUEST end up in different threads, with different thread contexts.

Try commiting the changes by doing a get_transaction().commit()
to propagate cross threads and see if that works?

Regards,
Johan




More information about the Zope mailing list