Re: EO Caching
Re: EO Caching
- Subject: Re: EO Caching
- From: Alexander Spohr <email@hidden>
- Date: Sat, 8 Dec 2007 13:13:06 +0100
Am 07.12.2007 um 22:56 schrieb Jeffrey Simpson:
Thanks for the prompt reply. I forgot to mention we have our own
batch
fetching that does a objectByPrimary key with a delegate that does
not do a
database fetch to weed out the object in memory.
Why and what for? EOF does this already well.
If you need a cache, give it an EC and some NSArrays to store the
objects. Use EOUtilities.localInstance to migrate objects into your
working-EC’s if you need to make connections.
I discovered that by having the ecs use strong references it did
what I
wanted. I also found out that is took to long to start an instance.
Same question as Chuck’s: What amount are you loading in what kind of
way?
In our system each session has a default editing context that we
only use
for querying. Any thoughts on every session sharing the same
default ec?
This way the cache would slowly build.
No, don’t do this! Sessions should not interfere with each others data
- not even for reads.
I think the real answer is for us to slowly rewrite our application
to use
more raw rows.
Sorry for being rude, but either you did not understand EOF’s
mechanics, or EOF is the wrong choice for your app. Raw rows is only
for mass-data, not for something to be cached and used by the object-
graph.
I really think you have some speed problems at other places. I put my
bets on loops that fire faults... Watch your EOAdaptorDebug output.
atze
On 12/7/07 1:41 PM, "Chuck Hill" <email@hidden> wrote:
On Dec 7, 2007, at 7:01 AM, Jeffrey Simpson wrote:
I want to preload some EOs and so they are cached. I have set
ERXEC.setDefaultFetchTimestampLag(86400000);
That only applies to faulting, not fetching. You might want to look
at the much feared EOSharedEditingContext or at Wonder's EO caching
classes (there are three or so, IIRC). Also look at the "Cache in
memory" setting in EOModeler.
I preload my EOs and do some
batch fetching. Later on I use a fetch spec to query from the
database some
of the cached EOs. They are fully fetched which I understand is the
case.
When I then batch fetch these EOs the system always runs fetches.
It is not clear to me what code you are using here. I will note that
all fetches (ec.objectsWithFetchSpecification) go to the database,
even if the fetched data is then discarded. Batch fetching is a
fetch.
The time
between this fetch and the preloading is < 5 minutes. If I run the
same
query in a the same ec then the EOs are cached. Any idea of why
there is no
caching between the 2 ecs?
No, not without a clearer understanding of your code.
Chuck
Jeffrey Simpson
Youth For Understanding USA
email@hidden
Telephone: (240) 235-2114
FAX: (202) 235-2104
Preparing young people for their responsibilities and opportunities
in a
changing, interdependent world.
_______________________________________________
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
Freeport & Soliversum
Alexander Spohr
email@hidden
www.freeport.de
_______________________________________________
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