Can we order DO to refresh the content of an objects?
I.e. reread the data from the DB.
Yes:
var originalMergeMode = disconnectedState.MergeMode; // MergeMode.Strict by default
disconnectedState.MergeMode = MergeMode.PreferNew;
try {
// Read some data. It will replace the data in DS in any case.
}
finally {
disconnectedState.MergeMode = originalMergeMode;
}
MergeMode
defines default merge policy for DisconnectedState.
Does DO allow for changes in the DB to be taken into memory
when no local changes have been made?
No. I.e. currently you can:
- replace know
Entity
state with the new one
- reject new ones, if there is a known
Entity
state
- throw an exception in case there is known + new
Entity
with conflicting version. Note that "known version" is the version of Entity
on the moment it was read for the first time (i.e. not the current one).
In your case we must add a flag like MergeMode.UpdateUnchanged
- is it a good solution?
answered
Jan 11 '11 at 03:29
Alex Yakunin
2971●4●4●12