exclude some relationships/entities from fetchTimestamp?
exclude some relationships/entities from fetchTimestamp?
- Subject: exclude some relationships/entities from fetchTimestamp?
- From: OC <email@hidden>
- Date: Sat, 14 Feb 2015 12:34:43 +0100
Hello there,
another possible way of optimization would be if I did not refetch _all_ objects touched, but only those which do need a refetch.
Means, when saving important data which can be changed anytime by another thread or instance, I exploit the pattern
===
EOObjectStore osc=ec.rootObjectStore()
osc.lock()
try {
EOEditingContext tempec=ERXEC.newEditingContext(osc)
tempec.fetchTimestamp=System.currentTimeMillis()
def tempau=auction.localInstanceIn(tempec),tempusr=user.localInstanceIn(tempec)
... ... ...
===
and then I am using tempau, tempusr and their relationships knowing they definitely are as fresh as possible.
That's great and works like a charm. Nevertheless, there are _some_ special reationships of which I happen to know -- based on my business logic -- they _can't_ ever be stale; the appropriate EOs are refetched anyway, though, caused by fetchTimestamp.
It would help if I could somehow tell to the temporary EC that either some relationships, or -- this would make much more sense in general -- some entities _do not_ need to be refetched, and if it finds snapshots of their EOs in the stack, it could freely use the cached values, regardless fetchTimestamp.
Is there a way to achieve that, or something functionally similar?
Thanks,
OC
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden