Re: Optimization - Share All Objects -> Register Database Context?
Re: Optimization - Share All Objects -> Register Database Context?
- Subject: Re: Optimization - Share All Objects -> Register Database Context?
- From: Ian Joyner <email@hidden>
- Date: Tue, 16 Aug 2005 10:24:25 +1000
Thanks Chuck and others for explanations. It seems the enumeration
table (for the pull down menu titles) is only loaded once for the
first screen to use them, due to the 'Cache in memory' setting. I
also found that the 'Fetch on load' setting in Interface Builder was
necessary just to load the titles (but this was not mentioned in
Chapter 21 of WO5 JCDA) and maybe explains why I had problems a few
months ago getting these to reliably work, although 'FOL' did seem
like the correct thing.
Anyway, that is worth a new question.
Thanks
Ian Joyner
Sportstec
On 16/08/2005, at 4:28 AM, Chuck Hill wrote:
On Aug 10, 2005, at 9:23 PM, email@hidden wrote:
Hi Ian;
Thanks. I set cache in memory a long time ago, hoping it would
have the effect I am now trying to achieve. For this application,
read only is fine because I just set the values in the DB with
SQL, but if I want to write a small application for this (for
localization), does this mean it won't work with this model?
Perhaps a good way to get around this is to make another version
of the model where these entities are not cached and make a small
D2W application around them for editing? Or... just accept they
have to come to you to get the reference data modified. :-)
[2005-08-11 13:41:40 EST] <WorkerThread13>
java.lang.IllegalArgumentException: EOEditingContext:
initializeObject: attempt to initialize object with global ID
_EOIntegralKeyGlobalID[Title (java.lang.Integer)2] that exists in
a shared context via a non-shared context. The object model may
have a relationship from a shared entity to a non-shared entity.
Disable or remove the relationship from the model.
You can probably appreciate that I can't see your model so it's
hard to ascertain what the problem is, but essentially *all*
entities marked as "read-only" / "cache in memory" are going to
reside in the "shared editing context"
That does not sound correct. Read only causes EOF to check that
there have been no changes to an object's properties when
saveChanges() is called on an editing context. Cache in memory
overrides the snapshot reference counting and expiration mechanism
so that snapshots are never garbage collected or expired. It also
forces a "fetch all" when the first reference to a cached object of
an entity is made.
and you are not allowed to have an outbound relationship from the
shared editing context to a regular editing context. So go
through all of the entities you have marked as "read-only" /
"cache in memory" and remove all their relationships that would
extend from the shared editing context to a regular editing
context at runtime.
Chuck
--
Practical WebObjects - a book for intermediate WebObjects
developers who want to increase their overall knowledge of
WebObjects, or those who are trying to solve specific application
development 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:
40sportstec.com
This email sent to email@hidden
_______________________________________________
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