Re: EOModels occasionally loading too slowly?
Re: EOModels occasionally loading too slowly?
- Subject: Re: EOModels occasionally loading too slowly?
- From: Mike Schrag <email@hidden>
- Date: Tue, 3 Nov 2009 15:22:44 -0500
I was thinking the same ... Every model should be loaded at startup.
If you're using Wonder, we do all kinds of crazy stuff at startup with
the models, and everything would just blow up if you were missing
models. In fact, we go through a bunch of pains to figure out when all
the bundles are loaded so that all the models are available to be
resolved.
You're doing something weird. Going completely out on a limb, I
nominate touching EOF in a static initialization block as your problem.
ms
On Nov 3, 2009, at 3:15 PM, Chuck Hill wrote:
I've never seen this and can't think of why they would not be loaded
when the framework is referenced. Are some of the frameworks not
getting referenced until later? Does adding
NSBundle.allBundles() to the Application constructor help?
My only other idea is that you are somehow messing with application
loading.
Chuck
On Nov 3, 2009, at 3:47 AM, Paul Hoadley wrote:
On 03/11/2009, at 9:51 PM, Gennady Kushnir wrote:
Normally EOmodels are loaded on demand (when they are requested)
you may force EModel to load calling
EODatabaseContext.forceConnectionWithModel
see API for details
Thanks Gennady. So presumably my assumption about the cause here
is all wrong:
The problem appears to be that not all the models have loaded by
the time
that page is being displayed. Indeed, checking
EOModelGroup.defaultGroup()
shows between 1 and 4 or 5 of the 8 models have been loaded by
the time that
entity is needed on the default page. Sometimes the correct
model has
loaded, and the page is displayed. Other times it hasn't, and
the app bails
out with that error. By the time Application.didFinishLaunching
() is
called, they're all loaded.
If they're loaded on demand, that doesn't explain this:
Error: java.lang.IllegalArgumentException: An object store for
the entity "Status" could not be found. Verify that the entity is
defined in an EOModel, and that the model is installed properly.
To see what models are loaded, you can try printing the return
value of EOModelGroup.defaultGroup() in your application.
It certainly is defined in an EOModel, and the EOModel is sitting
in an included framework. Can anyone suggest why I might get this
error on one run, and then get normal operation on the very next
run? (I don't have to do anything between runs. Just hit stop,
launch again and see if it works.)
--
Paul.
w http://logicsquad.net/
h http://paul.hoadley.name/
_______________________________________________
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
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
_______________________________________________
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