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