• 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: [Wonder-disc] NSUndoManager is Mandatory for any EOEditingContext
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wonder-disc] NSUndoManager is Mandatory for any EOEditingContext


  • Subject: Re: [Wonder-disc] NSUndoManager is Mandatory for any EOEditingContext
  • From: Lachlan Deck <email@hidden>
  • Date: Fri, 23 May 2008 08:29:02 +1000

On 23/05/2008, at 3:33 AM, Chuck Hill wrote:

On May 22, 2008, at 8:53 AM, email@hidden wrote:

1)
===============================
I have found that doing:

editingContext.setUndoManager(null);

Will create the following error when you attempt to delete and save an EO that has a delete rule of "deny" on an existing relationship (using WO 5.3):

java.lang.RuntimeException: java.lang.IllegalStateException: Editing context needs an undo manager to recover from delete propagation problems. Do not set the undo manager of this editing context to null.

Yes, you need the undo manager if you have delete rules, esp deny rules.

Ah. Good to know.

2)
===============================
Additionally, if I try the following:

editingContext.undoManager().disableUndoRegistration();

I find that little undo / redo pieces are still allocated in memory... which defeats the purpose of removing registration. This can be verified with a tool such as Jprofiler, etc. Any tool which allows you to view the java heap and memory allocations.

Yes.

Probably a bug report should be filed. But a work-around would be supplying a subclass that does nothing with the register* actions if disabled is true.


3)
===============================
After reflecting on notes #1 and #2 above, its safe to say that the NSUndoManager is an integral part of the EOEditingContext and should neither be crippled nor removed. Calling the following after saving changes, as currently recommended in the wiki, might make sense:


editingContext.undoManager().removeAllActions();

That is what I do. I have an EC subclass that calls this after a successful super.saveChanges(). That way, I don't have to remember to do this.

Good tip. Done :-)

with regards,
--

Lachlan Deck
_______________________________________________
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: 
 >Re: [Wonder-disc] NSUndoManager is Mandatory for any EOEditingContext (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: 5.3.3 API docs?
  • Next by Date: Re: WOWODC
  • Previous by thread: Re: [Wonder-disc] NSUndoManager is Mandatory for any EOEditingContext
  • Next by thread: WOWODC
  • Index(es):
    • Date
    • Thread