RE: Refreshing objects [BUG FIX/WORKAROUND]
RE: Refreshing objects [BUG FIX/WORKAROUND]
- Subject: RE: Refreshing objects [BUG FIX/WORKAROUND]
- From: <email@hidden>
- Date: Thu, 13 May 2004 09:00:06 +0200
- Thread-topic: Refreshing objects
Hi!
The fix to this is to subclass the EODatabaseContext to override.
/** Internal method that handles prefetching of to-many relationships.<BR>
*
* // TBD This is a workaround to what looks like a bug in WO 5.1 & WO 5.2. Remove as soon as it's no longer needed
*
* The problem is that even refreshing fetches don't refresh the to-many relationships they prefetch.
**/
public void _followToManyRelationshipWithFetchSpecification(
EORelationship relationship,
EOFetchSpecification fetchspecification,
NSArray objects,
EOEditingContext editingcontext)
{
int count = objects.count();
for (int i = 0; i < count; i++)
{
EOEnterpriseObject object = (EOEnterpriseObject) objects.objectAtIndex(i);
EOGlobalID sourceGlobalID = editingcontext.globalIDForObject(object);
String relationshipName = relationship.name();
if (!object.isFault())
{
EOFaulting toManyArray = (EOFaulting) object.storedValueForKey(relationshipName);
if (!toManyArray.isFault())
{
EOFaulting tmpToManyArray =
(EOFaulting) arrayFaultWithSourceGlobalID(sourceGlobalID,
relationshipName,
editingcontext);
// Turn the existing array back into a fault by assigning it the fault handler of the newly created fault
toManyArray.turnIntoFault(tmpToManyArray.faultHandler());
}
}
}
super._followToManyRelationshipWithFetchSpecification(
relationship,
fetchspecification,
objects,
editingcontext);
}
Pierre
-----Original Message-----
From: email@hidden
[mailto:email@hidden]On Behalf Of Anthony Paras
Sent: Wednesday, May 12, 2004 10:30 PM
To: David Griffith; email@hidden
Subject: Re: Refreshing objects
Quite a while back I posted a bug on RadarWeb because I thought that...
if a fetch spec has setRefreshesRefetchedObjects set to true and is also set
to pre-fetch a to-many relationship, the to-many relationship should be
refreshed as well, so that the relationship reflects any added or removed
objects since it was last created.
The bug report just kind of sat there until it disappeared.
Did you try setting the fetch spec to prefetch the relationship? If that
didn't work, then maybe it's time to reenter this bug report.
- Tony
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.