Hey, I have a revision system setup with two tables, one contains the current revision of an entity and the other contains each revisions for the entities. I need to perform some locking on my model so that creation of the new revision and the updating of the header record happen atomically. This works great now in development mode with just the one user and a single ruby process, but as soon the site goes live and I open up more processes, the locking will be totally pointless. Ideally I''d like to still use the header record, rather than a ''current'' column on the revisions table. Perhaps I could store the locks on another daemon, do any Rails specific applications that do this already exist? What solutions have people used in situations like this? Cheers --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 9/14/06, Ian Leitch <port001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey, > > I have a revision system setup with two tables, one contains the current > revision of an entity and the other contains each revisions for the > entities. I need to perform some locking on my model so that creation of the > new revision and the updating of the header record happen atomically. This > works great now in development mode with just the one user and a single ruby > process, but as soon the site goes live and I open up more processes, the > locking will be totally pointless. > > Ideally I''d like to still use the header record, rather than a ''current'' > column on the revisions table. Perhaps I could store the locks on another > daemon, do any Rails specific applications that do this already exist? > > What solutions have people used in situations like this? >I think your best bet is using the db for synchronization. Picking the right isolation level for your transaction may be enough. If not, there''s always locking. Isak> Cheers > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Pessimistic locking is what I needed, I just didn''t know about it yet :) Guess I''ll have to wait for Rails 1.2 On 15/09/06, Isak Hansen <isak.hansen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 9/14/06, Ian Leitch <port001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hey, > > > > I have a revision system setup with two tables, one contains the current > > revision of an entity and the other contains each revisions for the > > entities. I need to perform some locking on my model so that creation of > the > > new revision and the updating of the header record happen atomically. > This > > works great now in development mode with just the one user and a single > ruby > > process, but as soon the site goes live and I open up more processes, > the > > locking will be totally pointless. > > > > Ideally I''d like to still use the header record, rather than a ''current'' > > column on the revisions table. Perhaps I could store the locks on > another > > daemon, do any Rails specific applications that do this already exist? > > > > What solutions have people used in situations like this? > > > > I think your best bet is using the db for synchronization. Picking the > right isolation level for your transaction may be enough. If not, > there''s always locking. > > Isak > > > > Cheers > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---