On Wed, Sep 10, 2008 at 1:42 PM, Difei Zhao
<[EMAIL PROTECTED]> wrote:
> Maurício proposed the increment_counter method, may I assume that is
> atomic?

This method does something like this:

"update model_table_name set counter_column = counter_column + 1 where
id = 'your row id' "

So, it's up to your database (and the isolation level that it's using)
to handle the atomicity of this call.

Put simply, it will usually work, unless your database has some
serious concurrency issues.

-- 
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
João Pessoa, PB, +55 83 8867-7208

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to