pmMDA.NET

IPagedCollection.DefaultOwnerModifiedAction Property

[This is preliminary documentation and subject to change.]

When implemented by a class, gets the default action for errors.

OwnerModifiedAction DefaultOwnerModifiedAction {get;}

Remarks

The data of this property may be modified to adjust the error behaviour. But the data is only analyzed if the next error occurs.

The action defines when to throw a PagingException, whether the local cache should be cleared and whether the local modifications should be cleared.

Errors may only occur when items are reloaded. Items are reloaded when the developer is iterating over a paged collection. It is dangerous to clear the local cache for paged sets because they will lose their current position in the list. This means that it is impossible to move to the next persistent item and the iteration stops before all items are iterated.

Even if the local modification will be discarded it will not be possible to store the owner, which is the data object that owns the indexed property represented through this collection, because it is impossible to discard the modification of other owner-properties. Therefore the timestamp of the owner is not be adjusted, and storing the owner will result in a PersistenceException.

It is also dangerous to ignore that kind of error. Ignoring the error in paged lists and bags may result in strange results because the indexes at which the items were replaced, inserted or removed may not match anymore with the persistent indexes. This means that wrong items were replaced and insertions are at the wrong place. If the error is ignored, the developer will not notice that he is working on a faulty list.

See the OwnerModifiedAction class for further information.

Note that it is possible to overwrite the default action by registering to the OwnerModified event.

See Also

IPagedCollection Interface | PmMda.Net.Dog.Paging Namespace