Am 14.08.2011 12:46, schrieb Teddy Zeenny: > That is an interesting idea. (Although I don't think it would give me > the exact SELECT .. FOR UPDATE functionality, but I guess it's as > close as I can get). It would only allow 1 Process to access the if clause and it would return *immediately* on *all* clients while FOR UPDATE blocks all other processes that try to SELECT the particular id (could be many, could be long). Of course, while SELECT...FOR UPDATE explicitly locks the row, the GET_LOCK functionality is an advisory technique where all participating sides have to obtain the lock (e.g. the code part that takes away the is_admin).
Anyway, I think your concerns are a bit overkill and probably a flaw in your application design (e.g. why would you have an is_admin flag and then later set privileges => 'all' in another query) Would it not solve the problem if you had a save() that does both at once? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
