List Info

Thread: need advice about race condition




need advice about race condition
user name
2006-09-01 10:41:23
There's a field in my User model that sometimes needs bulk
updates:

   User.update_all("cluster = #",
"cluster = # 
")

Now, suppose user with id 37 is affected by that particular 

update_all and updates his profile:

   1. user 37 is read
   2. update_all happens and changes 37's cluster
asynchronously
   3. user 37 is saved

now user 37 belongs to the wrong cluster. Unlikely but
possible. Is  
there a robust way to write that?

-- fxn

_______________________________________________
Rails mailing list
Railslists.rubyonrails.org
h
ttp://lists.rubyonrails.org/mailman/listinfo/rails
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )