Re: Enterprise Object Caching
Re: Enterprise Object Caching
- Subject: Re: Enterprise Object Caching
- From: Chuck Hill <email@hidden>
- Date: Fri, 25 Aug 2006 11:10:53 -0700
Hi Marcos,
On Aug 24, 2006, at 4:15 PM, Marcos Trejo Munguia wrote:
I have a doubt related to object caching, suppose you have the next
relationship A<->>B, if you fetch objects of A, then objects of B,
it isn't supposed that when you access objects of B through objects
of A this objects of B are already cached in memory and there's no
need to do a trip to the db to bring them?
The answer is complex. If there is no snapshot for the relationship a
().bs(), then EOF will go to the database to fetch all of the B
objects related to a, even if they are already cached. It won't use
the _data_ from these, only the primary keys. It uses these to form
EOGlobalIDs and turns the single array fault object into an array of
individual object faults. As each object fault in the array is
accessed, EOF turns it into and EO. If the object snapshot is in the
cache, then it is used. If it is not in the cache, it is fetched.
So, for a relationship of four objects which are not in memory there
will be five fetches: one to determine which objects are in the
relationship and one for each of those objects.
Because I,m debugging the SQL that EOF generates and this is not
happening, another query is performed to bring those objects B
related to object A. It isn't enough to fetch the objects that you
need to get them cached in memory?
The objects are cached in memory. The fetch you are seeing is to
determine which objects are in the relationship. That information is
stored separately from the snapshot for each object.
Chuck
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
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