Boris

> without using EOF : I had Application level objects used from all sessions,
> and I didn't have to do anything special to use them.

Nope, this was always an issue. You are lucky you never ran into a
problem if you were sharing objects that were in different ECs. Maybe
EOf3 is just doing a better job of telling you that something is not
right. Or maybe your app is readonly? If your data is readonly, there is
no problem in any case. if you make changes to objects by associating
them with objects from a different EC (your shared app-wide one), then
that is a problem... unless you get a local version of the object and
associate the local version.  

Usually if you are motivated for some reason to share objects in the app
and if the tables for the shared objects aren't big, you would be much
much better off marking the objects as read-only and cache-in-memory in
EOModeler. This makes EOF prefetch the objects ONCE and then feed cached
data to you from a shared repository into your ECs at runtime with no
need to copy anything or add code of any kind.

d

"Pogrebitskiy, Boris" wrote:
> 
> Thank all of you for response,
> 
> ways of solving my problem that you suggested are working, but it did make
> my
> life easy. I have class, that gets initialized from Application. and it
> stores bunch of dictionaries and arrays and this class answers on many
> questions.
> and if I'll try to go and create fault or localInstance of all objects
> returned from this "shared" class, will create session level code that will
> almost duplicate my shared class and it will loose it's meaning of "shared".
> 
> I hoped that I can do something very simple, just like I did in my old
> WOApp.
> without using EOF : I had Application level objects used from all sessions,
> and I didn't have to do anything special to use them.
> 
> Looks like it's not easy any more.
> 
> Thank you, Boris Pogrebitskiy@ TIAA-CREF
> 
> > I have data that l fetch only once for all sessions on Application level.
> > In order to fetch it I create new EOEditingContext.
> > As a result all objects will be stored on Application level inside of
> > created EditingContext.
> >
> > Custom objects created inside of a session can access objects created on
> > Application level, but this objects belong to different editingContext.
> > If I try to set "shared" object to attribute of my custom object created
> > on session level - it works, but if I try to save session editingContext -
> > NSInternalInconsistencyException :
> >
> >  _globalIDForObject:: EODatabaseContext 0x34045f0 unable to obtain global
> > id for OrganizationLevel object 0x3408620 from EOEditingContext 0x340f0a0
> >
> >
> > Based on documentation I can setParentObjectStore and it should work, but
> > it doesn't. Looks like this two editingContexts are not sharing
> > EODatabaseContext.
> >
> > - I know this is a task that some of you did many times and I just doing
> > something wrong. May be you can help me to find a problem...
> >
> > Thank you.

Reply via email to