Featured

About this Blog

This site does not store any files on its server.
We only index and link to content provided by other websites.

[Rails] Re: How to Synchronize?

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
marnen@marnen.org
--
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

0 comments: