But increment is inherently subject to concurrency issues, and the only way to 
safely avoid them is to use a row level lock when incrementing the value, which 
presents a whole host of complications of its own. 

Cheers,

Alex Sharp

On Jan 22, 2013, at 7:00 AM, Carlos Antonio da Silva 
<carlosantoniodasi...@gmail.com> wrote:

> I may be wrong but that's my understanding: #increment happens at instance 
> level, so it takes into account the current value at that particular 
> instance, whereas .update_counters is just a straight sql query, so it can 
> operate using column + value directly. If you want to allow the database to 
> determine the value, use the latter.
> 
> On Tue, Jan 22, 2013 at 12:54 PM, ChuckE <honeyryderch...@gmail.com> wrote:
>> The same update statement would work for MySQL as well.
> 
> 
> 
> 
> -- 
> At.
> Carlos Antonio
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-core+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-core?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to