Hello there,
well, having fetched raw rows all right, I need to post-process them,
essentially by checking each fetched raw row, and to some of them (not all, but
many) adding couple of extra attributes.
The safe and clean approach would, of course, be something like
=== safe&clean ===
def fetchedRawRows=ec.objectsWithFetchSpecification(fs)
def result=new NSMutableArray()
for (rr in fetchedRawRows)
if (needToAddSomething(rr))
def nrr=rr.mutableClone()
nrr.setObjectForKey(...) // more of these
nrr.removeObjectForKey(...) // when post-processed, some fetched BLOBs are
not needed anymore, NSData will be GCed in due time
result.addObject(nrr)
} else result.addObject(rr)
return result
===
in practice though those returned raw rows seem to be mutable
(com.webobjects.eocontrol._EOMutableKnownKeyDictionaries, whatever that means),
and the unsafe unclean but considerably more efficient approach actually seems
to work:
=== quick&dirty ===
def fetchedRawRows=ec.objectsWithFetchSpecification(fs)
for (rr in fetchedRawRows)
if (needToAddSomething(rr)) {
rr.setObjectForKey(...) // more of these
rr.removeObjectForKey(...) // unlike above, might be GCed immediately if
need be
}
return fetchedRawRows
===
Since fetchedRawRows will tend to be rather at the huge side, quite probably
the difference will be notable.
Can someone say by experience or by a deep knowledge that the quick&dirty
approach is actually safe? Or, contrariwise, that if I embrace it, sooner or
later the hell will break loose?
Thanks!
OC
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]