<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Puaggggggggggg, relational...</div><div><br></div><div>Well, &nbsp;you can replace &nbsp;the block for a empty block in the continuation...but this is advance seaside :P,&nbsp;</div><div><br></div><div>You can extend WAApplication and extend handle request...</div><div><br></div><div>regards.</div><br><div><div>El 05/08/2009, a las 16:45, Mariano Martinez Peck escribió:</div><br class="Apple-interchange-newline"><blockquote type="cite">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't want it to get persisted twice or I don'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-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-left: 1ex; position: static; z-index: auto; ">The point is that, for every click you do, seaside run a continuation<br> it is identified by the &nbsp;_s _f and &nbsp;a number.<br> <br> At this point when you assign a block to call back the blk is<br> leads to the context, where count is a value x, eg 20<br> <br> if you run &nbsp;70 times the same continuation, count value will be the same 21 &nbsp;(20 +1).<br> <br> because that, &nbsp;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 &nbsp;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> &nbsp; Transcript show: 'renderContentOn'; cr.<br> &nbsp; html heading: count.<br> &nbsp; html anchor<br> &nbsp; &nbsp; &nbsp; callback: [ self increase ];<br> &nbsp; &nbsp; &nbsp; with: '++'.<br> &nbsp; html space.<br> &nbsp; html anchor<br> &nbsp; &nbsp; &nbsp; callback: [ self decrease ];<br> &nbsp; &nbsp; &nbsp; with: '--'<br> <br> <br> increase<br> &nbsp; Transcript show: 'increase'; cr.<br> &nbsp; count := count + 1.<br> &nbsp; (Delay forSeconds: 3) wait.<br> <br> <br> Now, suppose the counter is in 0. I click one time on '++' 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 '++' 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't call until all of the self increase of that session finish.<br> 3) when renderContentOn &nbsp;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't want it to get persisted twice or I don'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> _______________________________________________<br>seaside mailing list<br><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br></blockquote></div><br></body></html>