unique objects
Chris Muller
asqueaker at gmail.com
Fri Aug 10 01:02:38 UTC 2007
> Ok, registering a user will not be a very frequent operation, but I can
> think of a scenario in which between
> performing a #where: and actually adding the new user, another user has
> managed to register with the same
> login and commit the changes to the DB. Is there a way to make the
> #where: followed by #add: execute
> as a single atomic operation? or should I find a way to implement a
> synchronization mechanism (maybe based on
> locking, if this is possible in maven)?
If you use a standard Smalltalk collection, you'll get a commit
conflict. Since MagmaCollections are reduced-conflict, you'll need to
do something extra. For example, you could "reserve" the login by
adding it to a Smalltalk Set in a pre-commit. If successful, add it
to the MagmaSet and remove it from the reserve-Set in a post-commit.
There are probably other ways too.
>
> Best regards,
> cdan.
>
>
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>
More information about the Magma
mailing list