Hi all, I''ve searched the forumns, but I can''t seem to find an answer to this one. I''m having trouble getting optimistic locking (OL) to work in my app, even though all of the pieces are there: * table has lock_version column, with default of 0 (zero) * lock_version column is being incremented by the first update (but the second doesn''t catch it) * I''m trapping for ActiveRecord::StaleObjectError, but it is never thrown But nothing seems to work. Note that currently, I''m still in development mode and using the scaffolding code that relies on update_attributes, but I haven''t found any documentation that states whether OL works/does not work in development mode or with update_attributes. Anyone have an answer for this, and/or code they are willing to share? Many thanks, Eric -- 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-/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?hl=en -~----------~----~----~----~------~----~------~--~---
Joe Seeley
2007-Aug-09 16:25 UTC
Re: Optimistic locking and update_attributes: not working?
I''m having the same problem. Does anyone have any ideas? I''ve Googled, looked at documentation and I''m coming up empty... -- 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-/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?hl=en -~----------~----~----~----~------~----~------~--~---
Apparently Analagous Threads
- When to use optimistic locking?
- update_Attributes stale Object error
- [PATCH server] Fixed db-omatic so it doesn't die due to an unhandled ActiveRecord::StaleObjectError exception.
- Implementing Optimistic Offline Lock - How ?
- Optimistic Locking Enhancements: Gem or Core?