Re: refreshRefetchedObjects
Ramsey Gurley <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.wonder-disc |
|---|---|
| Message-ID | <[email protected]> |
On Mar 8, 2013, at 3:07 PM, Chuck Hill wrote: > Hi Ramsey, > > > On 2013-03-08, at 2:02 PM, Ramsey Gurley wrote: > >> Hi all, >> >> So I'm reading EOFetchSpec's javadoc for refreshing on fetch and I see: >> >> "For example, suppose that an employee object is fetched and then refetched, without changing the employee between fetches. In this case you want to refresh the employee when you refetch it because another application might have updated the object since the first fetch. To keep the employee in sync with the employee data in the external repository you would need to replace the employee's outdated values with the new ones. On the other hand, if you have to fetch the employee, change it, and then refetch it, you would not want to refresh the employee. If you are to refresh it whether or not another application had changed the employee you would lose the changes that you have made to the object." >> >> However when I actually try this in Freshness Explorer, that is not what happens. If I fetch John Smith, change his name to Travis, then submit and [Fetch One EO] with the [x]refresh checkbox checked, it stays Travis in the EC. >> >> It seems rather silly to go to the database, fetch rows, and then ignore those fresh values in favor of some stale snapshots hanging around. :-/ > > You prefer to erase the user's unsaved changes? That's the thing, it doesn't erase the changes. The changes stay in place and only the values the user hasn't touched get updated (assuming they changed). > You need an EC delegate, see the method: > > boolean editingContextShouldMergeChangesForObject(EOEditingContext context, EOEnterpriseObject object) > > > Chuck > > -- > Chuck Hill > Executive Managing Partner, VP Development and Technical Services > > Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. > http://www.global-village.net/gvc/practical_webobjects > > Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C! > Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine! > > > > > > > > > > > ------------------------------------------------------------------------------ Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev