Thanks to all. Now I get it. But...I still wonder how can I manage double request.<br><br>c) how can I handle the famous double commit? suppose now self increase
does something in a relational database (like persisting an order or
something like that) and I don&#39;t want it to get persisted twice or I
don&#39;t want an error because of duplicated PK<br><br>thanks for the help!<br><br>mariano<br><br><div class="gmail_quote">On Wed, Aug 5, 2009 at 6:11 PM, Diogenes Alberto Moreira <span dir="ltr">&lt;<a href="mailto:diogenes.moreira@gmail.com">diogenes.moreira@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The point is that, for every click you do, seaside run a continuation<br>
it is identified by the  _s _f and  a number.<br>
<br>
At this point when you assign a block to call back the block is<br>
leads to the context, where count is a value x, eg 20<br>
<br>
if you run  70 times the same continuation, count value will be the same 21  (20 +1).<br>
<br>
because that,  Transcript show increase, increase, increase, renderContentOn and the count value is the same 21.<br>
<br>
because that, fixtemp is very important in squeak, and Pharo have better behavior.<br>
<br>
wich click is running all... but al run the same block<br>
<br>
regard (sorry for my google english).<br>
<br>
El 05/08/2009, a las 15:54, Diogenes Alberto Moreira escribió:<div><div></div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Bueno te lo contesto en castellano y despues trato de traducirlo. en otro mail (sorry for english speakers, my English is horrible)<br>
<br>
El punto es este, por cada click que haces se ejecuta un continuation que esta identificado por el _s para la session _k para el componete un numero de &amp;.<br>
en punto que cuando vos le asignas un bloque al call back el bloque se lleva el contexto, donde count tiene un valor x, por ejemplo 20<br>
<br>
por mas que ejecutes 70 veces, en el contexto del bloque count vale 20  e incease ejecuta count := 20 + 1.<br>
<br>
por eso en el transcript, te aperece increase, incease, rendercontentOn y el valor que toma count es simpre 21. (para nuestro ejemplo). y por eso lo importante del fixtemp en squeak y la mejora que significo Pharo.<br>
<br>
cual se ejecuta,,, todos.... pero todos hacen lo mismo...<br>
<br>
Espero ser claro....<br>
<br>
PD: mariano ponele onda y traducilo.<br>
<br>
Saludos<br>
<br>
El 05/08/2009, a las 15:40, Mariano Martinez Peck escribió:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi! I am trying to understand how seaside handle double or more, request. I started with the simpler example: WACounter, which has:<br>
<br>
renderContentOn: html<br>
   Transcript show: &#39;renderContentOn&#39;; cr.<br>
   html heading: count.<br>
   html anchor<br>
       callback: [ self increase ];<br>
       with: &#39;++&#39;.<br>
   html space.<br>
   html anchor<br>
       callback: [ self decrease ];<br>
       with: &#39;--&#39;<br>
<br>
<br>
increase<br>
   Transcript show: &#39;increase&#39;; cr.<br>
   count := count + 1.<br>
   (Delay forSeconds: 3) wait.<br>
<br>
<br>
Now, suppose the counter is in 0. I click one time on &#39;++&#39; and wait and I see in the transcipt:<br>
<br>
increase<br>
renderContentOn<br>
<br>
Ok, perfect. New session, 0 again. Now I click on &#39;++&#39; but before it finish, I click 3 times more (very quickly). I can see this in the transcipt:<br>
<br>
increase<br>
increase<br>
increase<br>
increase<br>
renderContentOn<br>
<br>
So, as I can see:<br>
<br>
1) the callback (self increase in this case) is called for every click.<br>
2) the renderContentOn isn&#39;t call until all of the self increase of that session finish.<br>
3) when renderContentOn  is called, the webpage shows the number 1 (which is correct instead of 4).<br>
<br>
Now the questions are:<br>
<br>
a) how does seaside can do that? every request has its own variables? I think this has to be with continuations but I want to be sure.<br>
b) which of all of the self increase is the one that is finally rendered? the first one?<br>
c) how can I handle the famous double commit? suppose now self increase does something in a relational database (like persisting an order or something like that) and I don&#39;t want it to get persisted twice or I don&#39;t want an error because of duplicated PK.<br>

<br>
Thanks for the help. I just want to understand how this is handle!<br>
<br>
best,<br>
<br>
Mariano<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote>
<br>
</blockquote>
<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br>