On Sep 21, 4:09 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas-
s.net> wrote:
> Frederick Cheung wrote:
> > On Sep 21, 3:57 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas-
> > s.net> wrote:
> >> > key.save
> >> to PostgreSQL.
>
> > would have thought that Active Record's optimistic locking would do
> > the job - if upon saving you get a StaleObjectError you know that you
> > need to try again.
>
> Perhaps it would; I've never used ActiveRecord locking at all, so I'll
> defer to you here.  However, I tend to think that locking should
> generally be implemented at the database level, not the application
> level, which is why I suggested pessimistic here.  Am I missing
> something?

Well with optimistic locking it is ultimately the database enforcing
stuff - after all it is the only thing that can. If my memory is
correct the docs for optimistic locking have a decent explanation of
how it works.

Fred
>
>
>
> > Fred
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> [email protected]
> --
> 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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to