CommitSafelly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

CommitSafelly

Denis Kudriashov
Hello,

I attach method commitSafelly: aBlock for session.

It's garanties that when commit block will failed transaction will aborted.

Maybe some analogue already exists?

_______________________________________________
Magma mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/magma

MagmaSession-commitSafelly.st (402 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: CommitSafelly

Chris Muller-3
You should simply catch MagmaCommitError instead of Error.  Also, I
recommend moving the return outside of the critical block.  I also
suggest simply #pass'ing the original error rather than #signal'ing a
new one, since the original error contains all of the details about
the conflicting objects and who changed them.

When a commit fails, the conflicting objects in the image are updated
with the repository contents.  Whether it is necessary to abort all
other work done by that client is up to the application.  It is not
always so, but it makes sense that sometimes it would be desirable..

 - Chris

On Tue, Oct 5, 2010 at 2:34 AM, Denis Kudriashov <[hidden email]> wrote:

> Hello,
>
> I attach method commitSafelly: aBlock for session.
>
> It's garanties that when commit block will failed transaction will aborted.
>
> Maybe some analogue already exists?
>
> _______________________________________________
> Magma mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>
>
_______________________________________________
Magma mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/magma