Re: WORepetition Only Updates on ec.saveChages()
Re: WORepetition Only Updates on ec.saveChages()
- Subject: Re: WORepetition Only Updates on ec.saveChages()
- From: Chuck Hill <email@hidden>
- Date: Tue, 06 Jan 2004 11:11:32 -0800
At 06:58 AM 06/01/2004 -0500, Drew Thoeni wrote:
>>> session.questionList = (NSMutableArray)temp;
>>> }
>>>
>> If this is game specific it would be better managed on this page. If
>> it is global, why not just fetch it once per session instead of once
>> per game?
>
>I get this. I had read it was better to use a single ec (I supposed for
>memory reasons). I have run into problems like you described (e.g.
>saving the context where unwanted changes were saved due to fetches to
>display data) and having a context per page would make those problems
>go away.
>
Yes, using a single EC will reduce memory load, but at the expense of
saving unwanted changes etc. I try to keep the defaultEditingContext for
read only data related to the session as a whole. I create peer editing
contexts when I need to edit data. There are two fairly easy things to do
that will help to limit memory consumption:
1. Associate the peer EC with its page and reduce the size of the page
cache so that the page and EC will be fairly quickly garbage collected.
2. After saving, discard the EC (unlock, dispose, null reference) and
replace it with an empty one if needed.
>> return context().page(); is slightly more efficient in all cases and
>> much more efficient in some (large numeber of components, target at
>> end of the page).
>
>Good tip. I'll have to research this to understand.
>
You might not find much on this. :-(
Chuck
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
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.