• 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: Unexpected awakeFromInsertion() behaviour
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unexpected awakeFromInsertion() behaviour


  • Subject: Re: Unexpected awakeFromInsertion() behaviour
  • From: David Avendasora <email@hidden>
  • Date: Thu, 17 Jan 2008 12:06:45 -0500

Hey all,

I just wanted to tie this email from Pierre Bernard into the whole awkeFromInsertion() thread, as this can have some quite unexpected and hard-to-trace impacts for Java Client projects (Mr. Peabody, please start the WABAC machine...):


-----Original Message-----
From: Pierre Bernard 
Sent: Friday, May 2, 2003 2:13 PM
To: Apple WebObjects Dev
Subject: Re: IllegalStateException: undo: undo manager is in invalid state -
Huh?


Hi!

I finally got hold of the root cause of my problem. You really have to like those stack traces which point to no line of code of your own. So all you get is a cryptic error message and the information that one of your many thousand lines of code somehow got the framework into a state it does not like. That is if the cause is not within the framework itself.

This is where a mailing list like this becomes invaluable by sharing hints and pointers. So I hope some day someone with the same problem will find this message in the archives and thus have one more possible solution to his/her problem to explore.

My mistake came from initializing attributes and relationships in awakeFromInsertion without first checking if these were not already initialized. I must have figured nothing much could have happened before awakeFromInsertion. Yet working with JavaClient awakeFromInsertion on the server side gets called after the EO gets saved from the client to the server. Thus what I thought to be initialization  actually overwrote values I entered in the client interface. What's more I used the same EO class on the client and on the server. Both created a new EO to attach to a to-one relationship. The one created on the server side overrode the one created by the client. This must have confused the undo manager. Actually it lead to a whole lot of bizarre behavior.

Thus the correct wa to initialize an attribute in awakeFromInsertion is:

if (attribute() == null)
setAttribute(myDefaultValue);

Now I wonder why I never ran into the same problem when working with nested editing contexts on the server. Is the behavior different? Has it changed recently? Or did I just plainly not see the problems.

Pierre.

-----Original Message-----
From: Pierre Bernard 
Sent: Friday, April 25, 2003 5:42 PM
To: Apple WebObjects Dev
Subject: IllegalStateException: undo: undo manager is in invalid state -
Huh?


Hi!

Lately I'm occasionally seeing the below exception in my JavaClient application and have no clue what the exact problem is or where to look for it. So I am hoping for someone on the list to already have seen this one.

This is with WebObjects 5.2. I do not use the undo manager explicitely. The exception occurs on a save after deleting an object and creating a new one of the same type.

TIA for any pointers.

Best regards
Pierre Bernard

So here it comes:

[2003-04-25 17:35:49 CEST] <WorkerThread5> <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request:
java.lang.IllegalStateException: undo: undo manager is in invalid state, undo was called with too many nested undo groups
[2003-04-25 17:35:49 CEST] <WorkerThread5> java.lang.IllegalStateException: undo: undo manager is in invalid state, undo was called with too many nested undo groups
at com.webobjects.foundation.NSUndoManager.undo(NSUndoManager.java:567)
at com.webobjects.eodistribution.EODistributionContext.responseToClientMessage(EODistributionContext.java:622)
at com.webobjects.eodistribution.WOJavaClientComponent.handleClientRequest(WOJavaClientComponent.java:1089)
at com.webobjects.eodistribution.WOJavaClientComponent.invokeAction(WOJavaClientComponent.java:338)
at com.webobjects.appserver._private.WOComponentReference.invokeAction(WOComponentReference.java:113)
at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction(WODynamicGroup.java:110)
at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java:950)
at com.webobjects.appserver.WOSession.invokeAction(WOSession.java:1136)
at com.webobjects.appserver.WOApplication.invokeAction(WOApplication.java:1313)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:196)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(WOComponentRequestHandler.java:287)
at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:322)
at com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:358)
at com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:432)
at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1244)
at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:167)
at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:248)
at java.lang.Thread.run(Thread.java:484)

 _______________________________________________
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: Unexpected awakeFromInsertion() behaviour
      • From: Robert Walker <email@hidden>
References: 
 >Unexpected awakeFromInsertion() behaviour (From: Peter Vandoros <email@hidden>)
 >Re: Unexpected awakeFromInsertion() behaviour (From: Chuck Hill <email@hidden>)
 >Re: Unexpected awakeFromInsertion() behaviour (From: Peter Vandoros <email@hidden>)
 >Re: Unexpected awakeFromInsertion() behaviour (From: Chuck Hill <email@hidden>)
 >Re: Unexpected awakeFromInsertion() behaviour (From: Peter Vandoros <email@hidden>)
 >Re: Unexpected awakeFromInsertion() behaviour (From: Chuck Hill <email@hidden>)
 >Re: Unexpected awakeFromInsertion() behaviour (From: Pierre Bernard <email@hidden>)
 >Re: Unexpected awakeFromInsertion() behaviour (From: Lachlan Deck <email@hidden>)

  • Prev by Date: array fault firing from addObjectToBothSidesOfRelationshipWithKey(, )
  • Next by Date: Re: How do I prevent WO5.4 from reading the whole request?
  • Previous by thread: Re: Unexpected awakeFromInsertion() behaviour
  • Next by thread: Re: Unexpected awakeFromInsertion() behaviour
  • Index(es):
    • Date
    • Thread