cdan at savatech.ro
Thu Aug 9 10:37:24 UTC 2007
Chris Muller wrote:
> > Hi Dan, if you have only a few users (less than 500) and the
> > collection doesn't change much, you may want to use a standard
> > Smalltalk collection (like a Set).
> > My guess is you want to display an error if someone tries to add a new
> > ULUser with the same #login as another. So using a Set or MagmaSet
> > might not report that a duplicate was attempting to be added, just
> > quietly ignore the add, leaving the registering user thinking they
> > were successful.
Doesn't MagmaSet signal a MagmaDuplicateObjectInCollection if one tries
to add a
duplicate object (#validateCanAdd:)?
> > Perhaps you want to just as easily perform a #where: (or #select:)
> > query in your application to see if some ULUser with that #login
> > already exists and then signal a UserError..?
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)?
More information about the Magma