Cathal O'Riordan wrote: [...] > My concern is that my code won't guard against a race condition where > 2 or more users try to register for a course that is near it capacity > limit. My first thought was to wrap the registration code in a > transaction and rollback if the capacity of registrations on a course > has been exceeded. [...]
Use check constraints in the DB and let *it*, not your app, worry about concurrency issues! If your DB server can't handle check constraints, get one that can. 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 -~----------~----~----~----~------~----~------~--~---

