Onur Gungor wrote:
[...]
> 
> But then how can I synchronize this method's usage? I am very new to web 
> development so I just heard about database locking.
> 
> Simply, how should I use the 
> ActiveRecord::Transactions::ClassMethods#transaction and 
> ActiveRecord::Base#lock!?
> 
> Would it be OK to create a model and its corresponding table for just 
> locking? i.e. Lock model and locks table.

That would be pointless.  If you wrap your DB operations in a 
transaction, you will automatically get the appropriate locks -- and the 
DB will keep track of them, so you don't have to.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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