I'm not even sure I know enough to ask this question correctly, but here goes.

I'm trying to make an application more efficient by moving the code table lists from the session to the application.

To do so, though, I need an editing context to hold the lists. But, I can't use the defaultEditingContext as I don't have a session upon application start.

So, I (wrongly, it seems) created an editing context in the application. I'm sure most of you can see what's coming.

When I went to use the popup that accesses the list, it can't match up the list to the already stored value (for items that are being editied) and it also can't find the correct object for items being saved. Error reported is: "Cannot obtain globalId for an object which is registered in an other than the databaseContext's active editingContext, object:..."

Clearly because I have two editing contexts and the session one (defaultEditingContext) can't see the objects in the one shown below (appEC).

So, if I want to make efficient use of memory by storing these rarely changing code table lists in the application, how does one go about storing them in an EC that the sessions can get to?

Regards,

Drew



        private EOEditingContext appEC = new EOEditingContext();

        public static void main(String[] argv) {
                WOApplication.main(argv, Application.class);
        }

        public Application() {
                NSLog.out.appendln("Welcome to " + name() + "!");
                /* ** put your initialization code in here ** */
                
                WOMessage.setDefaultEncoding("UTF8");
        }

        
        /*** CODE TABLE LISTS ***/

/** Builds an array of all available Language objects recorded in the database. * This is not to be confused with languages supported by the browser or
         * languages as part of ERXLocalizer.
         * The array is used by components to build, for example, pop-up lists.
         * @return NSArray List of all available languages.
         */
        @SuppressWarnings("unchecked")
        public NSArray<Language> languageList() {
return (NSArray)EOUtilities.objectsWithFetchSpecificationAndBindings( appEC, "Language", "FetchAllAvailableLanguages", null );
        }

<snip>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to