Yes I have read the whole wiki several times I think, thanks for writing it. Magma would be virtually useless without it. I think I'll go with staying in a transaction all the time and see where it gets me.<div><br><br>
<div class="gmail_quote">On 20 December 2011 03:11, Chris Muller <span dir="ltr"><<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Milan, I don't know if you saw this one too,<br>
<br>
<a href="http://wiki.squeak.org/squeak/5605" target="_blank">http://wiki.squeak.org/squeak/5605</a><br>
<br>
which mentions staying in a transaction all the time as one of a few<br>
possible-strategies for committing.<br>
<br>
It used to be (a long time ago) that long transactions were a<br>
challenge due to getting disconnected from the server whenever there<br>
was too much commit-activity (by the other clients) accumulated<br>
against against the session. The accumulated changes are cached in<br>
memory on the server so unresponsive sessions must eventually be<br>
trimmed.<br>
<br>
But that could be frustrating for the client because, sometimes the<br>
user just had to do a _lot_ of work, and so it was all the worse to<br>
not be able to commit that work. The solution was to make<br>
transactions be able to span session connections. Now transactions<br>
can be weeks long, if desired.<br>
<br>
If a session disconnects with a transaction open (e.g., save and exit<br>
the image -- time to board the plane), the image can be restarted and<br>
work inside the transaction resumed later. When the session is<br>
reconnected, the users work is all still there in the image, but any<br>
other objects which were changed in the meantime must be refreshed to<br>
their current state -- so it's necessary to review. BTW, this the<br>
reason there can sometimes be a pause after reconnecting a<br>
long-disconnected session (the refresh), but its precisely what the<br>
system should do -- preserve the persistent state of my saved image<br>
and let me commit it later, when I'm good and done.<br>
<br>
So, leaving a transaction open is now a totally viable option and can<br>
be a fine way to go, depending on the application.<br>
<span class="HOEnZb"><font color="#888888"><br>
- Chris<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Mon, Dec 19, 2011 at 12:55 PM, Chris Muller <<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>> wrote:<br>
> In magma, #begin performs an implicit #refresh, not an implicit #abort.<br>
><br>
> See:<br>
><br>
> <a href="http://wiki.squeak.org/squeak/2636" target="_blank">http://wiki.squeak.org/squeak/2636</a><br>
><br>
><br>
><br>
> On Mon, Dec 19, 2011 at 11:00 AM, Milan Mimica <<a href="mailto:milan.mimica@gmail.com">milan.mimica@gmail.com</a>> wrote:<br>
>> I have spent some time trying to use Magma properly, hoping that some things<br>
>> that weren't clear at the beginning will eventually come clear. But one<br>
>> thing I still don't get: transactions. I understand transaction semantics in<br>
>> RDMS, but what does it mean in magma?<br>
>><br>
>> What is the difference between modifying an object inside and outside<br>
>> transaction? This two code snippets don't show any difference.<br>
>><br>
>> session := ...<br>
>> model := session root model.<br>
>> model firstName: 'foo'.<br>
>> session begin.<br>
>> model lastName: 'bar'.<br>
>> session commit.<br>
>><br>
>> session := ...<br>
>> model := session root model.<br>
>> session begin.<br>
>> model firstName: 'foo'.<br>
>> model lastName: 'bar'.<br>
>> session commit.<br>
>><br>
>><br>
>> They both commit both firstName and lastName properties, so I don't see any<br>
>> use of opening and ending a transaction. Couldn't there just be a commit<br>
>> message, so that you are always in a transaction, as that is how it<br>
>> apparently works?<br>
>><br>
>><br>
>> --<br>
>> Milan Mimica<br>
>> <a href="http://sparklet.sf.net" target="_blank">http://sparklet.sf.net</a><br>
>><br>
>> _______________________________________________<br>
>> Magma mailing list<br>
>> <a href="mailto:Magma@lists.squeakfoundation.org">Magma@lists.squeakfoundation.org</a><br>
>> <a href="http://lists.squeakfoundation.org/mailman/listinfo/magma" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/magma</a><br>
>><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Milan Mimica<br><a href="http://sparklet.sf.net">http://sparklet.sf.net</a><br>
</div>