• 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
Re: Fetch/saveChanges in Application Class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetch/saveChanges in Application Class


  • Subject: Re: Fetch/saveChanges in Application Class
  • From: "Jerry W. Walker" <email@hidden>
  • Date: Sun, 23 Dec 2007 18:50:34 -0500

Hi, Emmanuel,

I'm not sure what problem you're having with fetching from the Application class, but the one that comes most immediately to mind is that you don't have a default EOEditingContext in the Application class like that provided by your Session class and usable from any of your Session based WOComponents.

To solve that problem, just create your own but remember to lock it before using it or any of the EOs associated with it and to unlock it when you're done.

Typical code would look something like this:

    EOEditingContext ec = new EOEditingContext();

    try {
        ec.lock();

EOFetchSpecification fs = new EOFetchSpecification ("myEntity", null, null);
NSArray myThings = ec.objectsWithFetchSpecification(fs);


        ...
        //  Do some things with myThings...

        ec.saveChanges();

    } finally {
        ec.unlock();
    }

Regards,
Jerry

On Dec 23, 2007, at 10:25 AM, Emmanuel KOPP wrote:

Hi,

I developping a game with WO.

How I can do a Fetch in Application Class and excecute a saveChanges on this fetch in Application Class ?

an idea ??

Thanks

Manu


--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems


    email@hidden
    203 278-4085        office



_______________________________________________
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


References: 
 >Fetch/saveChanges in Application Class (From: Emmanuel KOPP <email@hidden>)

  • Prev by Date: Re: Tomcat Deployment
  • Next by Date: Re: Thick as a Brick
  • Previous by thread: Re: Fetch/saveChanges in Application Class
  • Next by thread: Thick as a Brick
  • Index(es):
    • Date
    • Thread