• 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: IllegalStateException: "...EOEditingContext has already been disposed"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IllegalStateException: "...EOEditingContext has already been disposed"


  • Subject: Re: IllegalStateException: "...EOEditingContext has already been disposed"
  • From: Philippe Rabier <email@hidden>
  • Date: Thu, 29 Sep 2016 15:32:21 +0200


On 29 sept. 2016, at 12:18, Paul Hoadley <email@hidden> wrote:

When do you dispose of the EC?

I don’t formally dispose of it. I just let it eventually fall out of scope and get GC’d. Is that a bad idea?

No but seems the right thing to do. I was just trying to understand how it was getting a null editing context

When should you normally explicitly dispose() an EC? That’s really not something I do very much of at all.

Hi Paul, 

It helps to free up memory sooner than waiting for GC. 
I used it in the RR loop or when you have a big number to objects to manipulate (export job or whatever) if you can’t do raw sql. Rather than having a single ec, you can can dispose and create a new one every batch of x EOS.
 
I used this piece of code all the time:

EOEditingContext ec = newEditingContext();
ec.lock();
try {
 ...
} catch (Exception e) { 
  log.error("method: blabla ", e); 
} finally { 
  ec.unlock();
  ec.dispose();
} 

Best,

Philippe

 _______________________________________________
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: IllegalStateException: "...EOEditingContext has already been disposed"
      • From: Paul Hoadley <email@hidden>
References: 
 >IllegalStateException: "...EOEditingContext has already been disposed" (From: Paul Hoadley <email@hidden>)
 >Re: IllegalStateException: "...EOEditingContext has already been disposed" (From: Chuck Hill <email@hidden>)
 >Re: IllegalStateException: "...EOEditingContext has already been disposed" (From: Paul Hoadley <email@hidden>)
 >Re: IllegalStateException: "...EOEditingContext has already been disposed" (From: Chuck Hill <email@hidden>)
 >Re: IllegalStateException: "...EOEditingContext has already been disposed" (From: Paul Hoadley <email@hidden>)

  • Prev by Date: Re: MySQL5.1 to 5.5
  • Next by Date: Re: IllegalStateException: "...EOEditingContext has already been disposed"
  • Previous by thread: Re: IllegalStateException: "...EOEditingContext has already been disposed"
  • Next by thread: Re: IllegalStateException: "...EOEditingContext has already been disposed"
  • Index(es):
    • Date
    • Thread