[Seaside] How do you handle constraints on persisted collections?

Dale Henrichs dale.henrichs at gemstone.com
Tue May 19 22:59:37 UTC 2009


As Ramon mentioned earlier: 

  "if the field were unique I'd have modeled that by hashing it in a dictionary by that fields value."

GemStone provides an RcKeyValueDictionary that allows for conflict free concurrent updates when keys do not collide. Commit conflicts occur if an attempt is made by two sessions to concurrently add or remove the same key.

If two users pick the same new name (because there is no existing key in their views), they will both attempt to commit with the new name and the second user to commit will get a commit conflict, in GLASS, the http request is retried on a commit failure and when the rename request is attempted the second time, the key will have already been taken so the slow user should be told that the name is already taken.

Dale
----- "Boris Popov" <boris at deepcovelabs.com> wrote:

| Clearly this would complicate the problem even further proving my
| point
| :)
| 
| -Boris 
| 
| -----Original Message-----
| From: seaside-bounces at lists.squeakfoundation.org
| [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of
| Ramon
| Leon
| Sent: Tuesday, May 19, 2009 3:22 PM
| To: 'Seaside - general discussion'
| Subject: RE: [Seaside] How do you handle constraints on persisted
| collections?
| 
| > Although, if two users are updating their usernames in separate
| > transactions (say, in GemStone), this would do nothing to prevent
| both
| > of them from succeeding, thus, this type of constraint checking
| really
| > only applies when adding users to a collection which would stop
| this
| > from happening by virtue of a commit conflict, no?
| > 
| > -Boris
| 
| Not if you're using a reduced conflict collection to allow concurrent
| updates of the collection, but otherwise yea you'd get a commit
| conflict.
| 
| Ramon Leon
| http://onsmalltalk.com
| 
| _______________________________________________
| seaside mailing list
| seaside at lists.squeakfoundation.org
| http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
| _______________________________________________
| seaside mailing list
| seaside at lists.squeakfoundation.org
| http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


More information about the seaside mailing list