It writes and reads objects in the session, maybe the probleme comes from here ? Here's a little sinppet :<br><br> def toutCompter(self):<br> """<br> xmlrpc methode, called from a web borwser.
<br> """<br> documentXML = ComptageXML()<br> #this reads and writes objects in the session<br> dicoLignes = self._fabriquerDicoLignes()<br> #do things with dicoLignes<br> for inumLigneCourante in xrange(borneInf,borneSup) :
<br> snumLigneCourante = str(inumLigneCourante)<br> ligne = dicoLignes[snumLigneCourante]["requete"]<br> #do things here<br> self._ajouterAuDico(snumLigneCourante,ligne,comptage,arbre)
<br><br> if ligne :<br> self._mettreEnSession(resultats)<br> <br> response = self.REQUEST.RESPONSE<br> response.setHeader("Content-Type","text/xml")<br> response.setHeader
("charset","utf-8")<br> chaineXML = documentXML.formatXML()<br> print "sending results to "+addresseIP<br> return chaineXML<br><br> def _fabriquerDicoLignes(self):<br>
formulaire = self.getForm()<br> dicoLignes = self.getSession(self,"dicoLignes") or {}<br> for key in formulaire.keys():<br> #do things...<br> self.setSession("dicoLignes", dicoLignes)
<br> return dicoLignes<br><br> def _fabriquerListeLignes(self):<br> dicoLignes = RacineAbstraite.getSession(self,"dicoLignes") or {}<br> listeNumeros = dicoLignes.keys()<br> listeNumeros.sort
( lambda x,y: cmp(int(x), int(y)) )<br> return [ dicoLignes[str(inumeroLigne)]["requete"] for inumeroLigne in \<br> sorted( [int(snumeroLigne) for snumeroLigne in dicoLignes.keys()] ) ]<br>
<br> def _ajouterAuDico(self,p_snumeroCle,p_ligne,p_comptage,p_arbre):<br> dicoLignes = RacineAbstraite.getSession(self,'dicoLignes') or {}<br> dicoLignes[p_snumeroCle] = {'requete':p_ligne,'comptage':p_comptage,'arbre':p_arbre}
<br> self.setSession('dicoLignes',dicoLignes)<br><br> def _mettreEnSession(self,p_resultats):<br> """<br> Mettre en session les résultats d'un comptage.<br> """
<br> <br> # Initialise de la SESSION<br> dicoResultatRecherche = {<br> 'listeCriteres' : [self._fabriquerListeLignes(), self.getForm('numeroLigne')],<br> 'nombreEntreprises' : p_resultats[0][0],
<br> 'listeComptage' : p_resultats,<br> 'listeEntreprises' : [],<br> }<br> #On conserve la requete et le resultat en session<br> self.setSession('resultatRecherche', p_dicoResultatRecherche.copy())
<br><br><br>When toutCompter is called by browser 1, then he will write and read, say, the dicoLignes object in the session.<br>When toutCompter is called by browser 2 parallely, is it the same dicoLignes object that it tries to access or another one is created ? can there be conflicts somehow ?
<br><br>Y.Chaouche<br><br><div><span class="gmail_quote">2007/1/19, yacine chaouche <<a href="mailto:yacinechaouche@gmail.com">yacinechaouche@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I mean triple couples of lines of code.<br><br><div><span class="gmail_quote">2007/1/19, yacine chaouche <<a href="mailto:yacinechaouche@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
yacinechaouche@gmail.com</a>>:</span><div><span class="e" id="q_11039be1a78a2659_1"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The toutCompter methode does a lot of thing and it would take a triple couples of lines to describe what it does all.<br>Anyway, is there a way for me to detect ConflictErrors ? they don't appear on the console so i guess they are catched.
<br><br>Y.Chaouche<br><br><div><span class="gmail_quote">2007/1/19, Gabriel Genellina <<a href="mailto:gagsl-zope@yahoo.com.ar" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">gagsl-zope@yahoo.com.ar
</a>>:</span><div><span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At Thursday 18/1/2007 16:30, Andreas Jung wrote:<br><br><br>><zope trace to the console><br>>ip: <a href="http://10.75.49.155" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">10.75.49.155
</a> requests counting of lines 1 to 11<br>>ip: <a href="http://10.75.49.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
10.75.49.51</a> requests counting of lines 1 to 11<br>>sending results to <a href="http://10.75.49.155" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">10.75.49.155</a><br>>sending results to
<a href="http://10.75.49.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">10.75.49.51</a><br>>ip: <a href="http://10.75.49.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
10.75.49.51</a> requests counting of lines 1 to 11<br>>sending results to <a href="http://10.75.49.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">10.75.49.51</a><br>></zope trace><br>
><br>><br>>Zope says he got 2 requests form <a href="http://10.75.49.51" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
10.75.49.51</a> and sent it the results 2<br>>times. Ok, let's check the tcpflow then for these supposed connections :<br>>[...]<br>>Allright, there is only ONE POST request. So zope didnt really got two<br>
>requests. Now let's see if it sent the data two times as it presumes :
<br>>[...]<br>>The results were sent just one time, not two.<br>><br>>What is going on here ?<br><br>What does the toutCompter method really does? Does it modify some<br>object state? That might provoke a ConflictError, forcing a
<br>transaction abort and the request to be re-tried (up to three times,<br>silently, then it goes logged).<br><br><br>--<br>Gabriel Genellina<br>Softlab SRL<br><br><br><br><br><br><br>__________________________________________________
<br>Preguntá. Respondé. Descubrí.<br>Todo lo que querías saber, y lo que ni imaginabas,<br>está en Yahoo! Respuestas (Beta).<br>¡Probalo ya!<br><a href="http://www.yahoo.com.ar/respuestas" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.yahoo.com.ar/respuestas
</a><br><br>_______________________________________________<br>Zope maillist - <a href="mailto:Zope@zope.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Zope@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.zope.org/mailman/listinfo/zope
</a><br>** No cross posts or HTML encoding! **<br>(Related lists -<br> <a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.zope.org/mailman/listinfo/zope-announce
</a><br> <a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br></blockquote></span></div></div><br>
</blockquote></span></div></div><br>
</blockquote></div><br>