• 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: EOEditingContext.isDisposed() ... ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOEditingContext.isDisposed() ... ?


  • Subject: Re: EOEditingContext.isDisposed() ... ?
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 3 Sep 2010 19:04:59 -0400

On Sep 3, 2010, at 2:53 PM, Farrukh Ijaz wrote:

> Hi,
>
> Is there a way to check if the editingContext is disposed?

There is, but it is not exposed.


> I guess there should be something called isDisposed(), it is useful for following scenario.
>
> private EOEditingContext _editingContext;
>
> public EOEditingContext editingContext() {
> 	if(_editingContext == null || _editingContext.isDisposed()) {
> 		_editingContext = ERXEC.newEditingContext();
> 	}
> 	return _editingContext;
> }
>
> This ensures that whenever the call is made to editingContext(), the editing context will be valid.
>
> Just a thought.


I can't think of a good coding practice that would want that code.  dispose() is normally called by finalization.  If you dispose of your ECs manually, earlier, you should either null the reference or replace the EC.  That would be good coding practice.  Keeping a reference to a disposed EC seems... undesirable.

Chuck

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







 _______________________________________________
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.isDisposed() ... ?
      • From: Farrukh Ijaz <email@hidden>
References: 
 >EOEditingContext.isDisposed() ... ? (From: Farrukh Ijaz <email@hidden>)

  • Prev by Date: Re: WOO file
  • Next by Date: Re: EOEditingContext.isDisposed() ... ?
  • Previous by thread: EOEditingContext.isDisposed() ... ?
  • Next by thread: Re: EOEditingContext.isDisposed() ... ?
  • Index(es):
    • Date
    • Thread