Don't check constrainsts just ensure that data is a certain format?

On May 23, 12:21 am, Marnen Laibow-Koser <rails-mailing-l...@andreas-
s.net> wrote:
> 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-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> Posted viahttp://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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to