• 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: Wrong object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrong object


  • Subject: Re: Wrong object
  • From: David Avendasora <email@hidden>
  • Date: Mon, 24 Mar 2014 09:54:34 -0400

IIRC that was added to catch the case where a to-many was being iterated and got updated on the server.

+1 The array being iterated over has changed (on the server) either by sorting or by adding/removing elements from the array behind the repetition’s back. By default a repetition keeps track of the position of each element of the iterated-over array using a integer index value. If array element for index 2 is deleted, or a new element is inserted at index 2, element for index 3 of the array is no longer the EO it was originally, but the repetition doesn’t know that and still presents it as the values of the EO that used to be at index 3. 

This is especially problematic when you are using a Batching DisplayGroup. Making a change in one batch that will impact the rows displayed by another batch will almost certainly trigger this situation.

This can cause very insidious bugs where the EOF and your rendered webpage disagree on which EO is in a given row, and you can end up thinking your are selecting/editing/etc. one EO and actually be selecting/editing/etc. a different one. e.g., If you are creating a relationship to the selected EO in the repetition, you could very easily be creating the relationship to a completely different EO. - “I know I registered Chuck for the ‘Master Developer’ course, but instead he was registered for the “Master Proposal Writer” course. Oh, well. I’m sure he will like that, too."

The good news is that ERXWORepetition (which is automatically substituted in for WORepetition by Wonder) can use a Hash of the EO instead of an integer by setting the Property: 

er.extensions.ERXWORepetition.checkHashCodes=true

Or by simply adding the biding:

checkHashCodes=true;

to the WORepetition.

However, this is not a universal fix, there are still issues.

The Javadoc for ERXWORepetition (http://jenkins.wocommunity.org/job/Wonder/lastSuccessfulBuild/javadoc/er/extensions/components/_private/ERXWORepetition.html) explains what you can and can’t do. 

Dave’s Best Practice™: Be very careful about adding/removing elements from a batching display group. Consider completely throwing away the display group and building it up from scratch, just to be safe.

WebObjects Best Practice:™ “Be very careful about listening to Dave. Consider completely throwing away his advice and getting some safer “Chuck / Tim / Keiran / CandadianDave / AnybodyReally advice"

Dave


On Mar 22, 2014, at 8:29 PM, Chuck Hill <email@hidden> wrote:

IIRC that was added to catch the case where a to-many was being iterated and got updated on the server.

Chuck


On 2014-03-22, 1:12 PM, "Timothy Worman" wrote:

Hi Jeff:

Just stepping through the code ERXWORepetition, this warning is fired in invokeAction. It looks like a check is happening to make sure that objects are still in the expected position in the repetition. Is an action being fired that could be removing items from the repetition list or changing the order, or…..?

Tim

On Mar 21, 2014, at 10:57 PM, Jeffrey Schmitz <email@hidden> wrote:

Am seeing some of these warnings and wondering what they might indicate...
Mar 21 20:19:12 netBrackets[2002] WARN  er.extensions.components._private.ERXWORepetition  - Wrong object: 243620065 vs 34923469 (array = (<com.netbracketsfw.model.Entry pk:"1002578">, <com.netbracketsfw.model.Entry pk:"1002019">, <com.netbracketsfw.model.Entry pk:"1004605">, <com.netbracketsfw.model.Entry pk:"1002637">, <com.netbracketsfw.model.Entry pk:"1004919">, <com.netbracketsfw.model.Entry pk:"1003173">, <com.netbracketsfw.model.Entry pk:"1001801">, <com.netbracketsfw.model.Entry pk:"1002154">, <com.netbracketsfw.model.Entry pk:"1003232">, <com.netbracketsfw.model.Entry pk:"1002653">, <com.netbracketsfw.model.Entry pk:"1004099">, <com.netbracketsfw.model.Entry pk:"1002155">, <com.netbracketsfw.model.Entry pk:"1005810">, <com.netbracketsfw.model.Entry pk:"1001971">, <com.netbracketsfw.model.Entry pk:"1004269">, <com.netbracketsfw.model.Entry pk:"1002476">, <com.netbracketsfw.model.Entry pk:"1003582">, <com.netbracketsfw.model.Entry pk:"1004728">, <com.netbracketsfw.model.Entry pk:"1001732">, <com.netbracketsfw.model.Entry pk:"1003953">))
Mar 21 20:27:48 netBrackets[2002] WARN  er.extensions.components._private.ERXWORepetition  - Wrong object: 569528470 vs 417462206 (array = (<com.netbracketsfw.model.Entry pk:"1005383">, <com.netbracketsfw.model.Entry pk:"1003407">, <com.netbracketsfw.model.Entry pk:"1003647">, <com.netbracketsfw.model.Entry pk:"1004120">, <com.netbracketsfw.model.Entry pk:"1006124">, <com.netbracketsfw.model.Entry pk:"1004773">, <com.netbracketsfw.model.Entry pk:"1001695">, <com.netbracketsfw.model.Entry pk:"1006371">, <com.netbracketsfw.model.Entry pk:"1002149">, <com.netbracketsfw.model.Entry pk:"1001824">))
Mar 21 20:27:48 netBrackets[2002] WARN  er.extensions.components._private.ERXWORepetition  - Wrong object: 569528470 vs 415571783 (array = (<com.netbracketsfw.model.Entry pk:"1005383">, <com.netbracketsfw.model.Entry pk:"1003407">, <com.netbracketsfw.model.Entry pk:"1003647">, <com.netbracketsfw.model.Entry pk:"1004120">, <com.netbracketsfw.model.Entry pk:"1006124">, <com.netbracketsfw.model.Entry pk:"1004773">, <com.netbracketsfw.model.Entry pk:"1001695">, <com.netbracketsfw.model.Entry pk:"1006371">, <com.netbracketsfw.model.Entry pk:"1002149">, <com.netbracketsfw.model.Entry pk:"1001824">))
Mar 21 20:27:51 netBrackets[2002] WARN  er.extensions.components._private.ERXWORepetition  - Wrong object: 569528470 vs 694846676 (array = (<com.netbracketsfw.model.Entry pk:"1005383">, <com.netbracketsfw.model.Entry pk:"1003407">, <com.netbracketsfw.model.Entry pk:"1003647">, <com.netbracketsfw.model.Entry pk:"1004120">, <com.netbracketsfw.model.Entry pk:"1006124">, <com.netbracketsfw.model.Entry pk:"1004773">, <com.netbracketsfw.model.Entry pk:"1001695">, <com.netbracketsfw.model.Entry pk:"1006371">, <com.netbracketsfw.model.Entry pk:"1002149">, <com.netbracketsfw.model.Entry pk:"1001824">))
Mar 21 20:27:53 netBrackets[2002] WARN  er.extensions.components._private.ERXWORepetition  - Wrong object: 569528470 vs 87
_______________________________________________
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


_______________________________________________
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

—————————————————————————————
WebObjects - so easy that even Dave Avendasora can do it!™
—————————————————————————————
David Avendasora
Senior Software Abuser
Nekesto, Inc.





 _______________________________________________
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: 
 >Wrong object (From: Jeffrey Schmitz <email@hidden>)
 >Re: Wrong object (From: Timothy Worman <email@hidden>)
 >Re: Wrong object (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: DirectAction with multipart/form-data does not get multiple parameters
  • Next by Date: Re: Session-ID randomness
  • Previous by thread: Re: Wrong object
  • Next by thread: Derived attribute problem
  • Index(es):
    • Date
    • Thread