• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Question on fetching theory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on fetching theory


  • Subject: Re: Question on fetching theory
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 20 May 2009 10:55:02 -0700

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


  • Follow-Ups:
    • Re: Question on fetching theory
      • From: Gustavo Adolfo Pizano <email@hidden>
References: 
 >Question on fetching theory (From: Gustavo Adolfo Pizano <email@hidden>)

  • Prev by Date: Question on fetching theory
  • Next by Date: Re: Oracle driver...
  • Previous by thread: Question on fetching theory
  • Next by thread: Re: Question on fetching theory
  • Index(es):
    • Date
    • Thread