• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
EOEditingContext in Application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EOEditingContext in Application


  • Subject: EOEditingContext in Application
  • From: Drew Thoeni <email@hidden>
  • Date: Mon, 30 Jun 2008 23:25:34 -0400

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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: EOEditingContext in Application
      • From: Lachlan Deck <email@hidden>
    • Re: EOEditingContext in Application
      • From: Art Isbell <email@hidden>
  • Prev by Date: Re: Open used vs. Open Source
  • Next by Date: Re: Component action context().hasSession() returns false? [Was Re: context().hasSession() returns false... then true?]
  • Previous by thread: Re: Open used vs. Open Source
  • Next by thread: Re: EOEditingContext in Application
  • Index(es):
    • Date
    • Thread