Re: Question on fetching theory
Re: Question on fetching theory
- Subject: Re: Question on fetching theory
- From: Gustavo Adolfo Pizano <email@hidden>
- Date: Wed, 20 May 2009 21:21:06 +0200
Aha, so I will need to manage a way to know if that particular item
was selected already, if so then I wouldn't have to fetch again but
return what is in memory already? then if I want fresh data, I will
need to provide a way to make the fetches again, am I right?
Thanks
G
On May 20, 2009, at 7:55 PM, Chuck Hill wrote:
Fetches always go back to the server. Faults will use the cached
data. You are going to need to do some caching to avoid repeated
fetches.
Chuck
On May 20, 2009, at 10:23 AM, Gustavo Adolfo Pizano wrote:
Hello.
I think I have done something wrong.
As far as I know, and because the docs says so, I receive cached
data unless 3 conditions.
•
the timestamp of the snapshots of enterprise objects are older than
the editing context’s timestamp
•
the enterprise object has been invalidated
•
the enterprise object is a fault (its data hasn’t yet been fetched
In my application, I have a ERXEC, in which I did the following.
EOModel model = EOModelGroup.defaultGroup().modelNamed("LDAPModel");
NSMutableDictionary<String, String> overrides = new
NSMutableDictionary<String, String>();
overrides.takeValueForKey("ldap://localhost:389/
cn=Contacts,o=xws", "serverUrl");
EODatabaseContext.forceConnectionWithModel(model, overrides,abEC);
groups = XWSContactsGroup.fetchAllXWSContactsGroups(abEC,
new NSArray(new Object[]
{ERXSortOrdering.sortOrderingWithKey(XWSContactsGroup.CN,
ERXSortOrdering.CompareAscending)}));
I change the connection dictionary of the model for 2 reasons, was
the only documented way I found to do that in order to change the
BASE search on LDAP(old question I post on the list). And second,
so only that EC will have access to that level in the LDAP.
Anyway, as you know Im working with a AjaxSelectionList, which is
working (so far), so when I select some item, its the action
binding is firing a method in which Im fetching the data for that
particular item. Im doing the following.
NSArrray = contactLsits =
XWSContact
.fetchAllXWSContacts(abEC,XWSContact.PARENT.eq(selectedItem.cn),
new NSArray(new Object[]
{ERXSortOrdering.sortOrderingWithKey(XWSContacts.CN,
ERXSortOrdering.CompareAscending)}));
So I getting the array of contacts for the given group. ALL FINE,
perfect. if I select another group form the list, then again I get
a list of contacts for that new group, BUT, if I select the
previous group in the list, I see in the LDAP console that I made a
fetch again.
I thought I would get it from the EC without making a fetch, this
behavior, make same think, that if somebody start just clicking
between group items in the list, it will keep making fetchs to the
server, isn't this dangerous? I mean in big proportions?
Thanks in advance.
Gustavo
_______________________________________________
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
--
Chuck Hill Senior Consultant / VP Development
Come to WOWODC'09 in San Fran this June!
http://www.wocommunity.org/wowodc09/
_______________________________________________
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