> Another problem: If I have an Entity with a "published" flag and on
> another page I have the "edit entity" functionality. If I click on
> publish this entity (page A) ActiveRecord is making a full update -
> instead of updating only the flag (or datetime column). Another user
> can be on edit page to change content on page B. In this case - in the
> ActiveRecord case the last update wins - and the changes before get
> lost.

What you've outlined here is precisely the risk for partial updates.
Your model validations will ensure that each of the individual models
are internally consistent, then proceed to write only their changes to
the database.  The resulting record may, or may not, be valid, and
that's too risky.

> The model can be validated too - the complete record is available -
> only the generated update can be smaller.

No it doesn't as I've mentioned above.

> And a locking feature is OK - if I want to have it.Hibernate e.g.
> provides locking too (see
> http://www.hibernate.org/hib_docs/v3/reference/en/html/transactions.html#transactions-optimistic,
> http://www.hibernate.org/hib_docs/v3/reference/en/html/transactions.html#transactions-locking).

Rails supports both pessimistic and optimistic locking, just like
hibernate does.

> Perhaps acts_as_list can be changed that only the position column will
> be updated on position change - e.g. with move_higher.

If the only case where this makes a difference is entities with blobs,
then I don't think it justifies the significant risk implied by
partial updates.

Are there any other cases?




-- 
Cheers

Koz

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" 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-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to