Print Page | Close Window

PersistenceManager.Refetch

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=224
Printed Date: 13-Mar-2025 at 6:13am


Topic: PersistenceManager.Refetch
Posted By: Customer
Subject: PersistenceManager.Refetch
Date Posted: 12-Jul-2007 at 4:27pm
Can anyone provide a simpler example for PersistenceManger.RefetchEntites than provided in End_HandleCocurrencyConflicts?



Replies:
Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 4:28pm

That is a fairly complex scenario presented in the tutorial.  Is your question related more to why and when you'd want to use a Refetch, or how to use it?

Handling concurrency conflicts has been our "standard" use case for situations in which you know you want to refetch entities from the data source, and know what you want to do with the newly refetched data in terms of merging into local cache. 

A Refetch (and the various overloads) is really just a helper method which bypasses the quite complex internal logic which determines what data can be found locally vs. what must be retrieved from the data source.  It's essentially the same as re-running your query with a DataSourceOnly fetch strategy, but also allows you control over the subset of entities wanted.  Refetch is really not something you ever have to do - it's just available if you want it.

Both the Developer's Guide and Concepts manual have some discussions of "forced refetch", and also merge strategies, which may help some.




Print Page | Close Window