Error in AcceptChanges

Error in AcceptChanges

Old forum URL: forums.lhotka.net/forums/t/3597.aspx


casbornsen posted on Wednesday, September 26, 2007

Hi there folks.  I work with Dave Wendelken.  We just upgraded from 2.0 to 3.01 and are now experiencing an Edit level Mismatch in AcceptChanges when I try to save.  When I step through the code, it appears that AcceptChanges is called about 20 times and on the last call that is attempted, the EditLevel and parentEditLevel are both 0, so we get an exception.  This wasn't happening before, so could it be caused somehow by 3.01, or do you think we made a mistake in the upgrade? 

"An exception of type 'Csla.Core.UndoException' occurred in Csla.DLL but was not handled in user code.  Additional information: Edit level mismatch in AcceptChanges"

Thanks

ajj3085 replied on Wednesday, September 26, 2007

First, upgrade to 3.0.2 beta.  There is a fix in there IIRC regarding this.

Second, take a look at the project tracker sample; you have to do things in just the right order, including unbinding your datasource.  Follow the formula exactly and you should be ok.

The exception is there to help you catch databinding errors.  The way it has been don prior to 3.0.2 was always wrong, its just that nobody knew it. Smile [:)]

casbornsen replied on Wednesday, September 26, 2007

Oh gee whiz.  Do you know when the beta is supposed to end by any chance?  We can't put beta stuff in production.

casbornsen replied on Wednesday, September 26, 2007

Maybe I should read some of the upgrade stuff next time before I post:

"Csla – N-Level Undo (numerous classes) (070525-C#/VB)

Add ISupportUndo interface and rework the existing interfaces a bit so IUndoableObject is no longer in the main inheritance tree for the public interfaces.

 

This was done because the recent IUndoableObject interface changes to error check edit levels made UI framework development overly difficult. Rearranging the interfaces this new way is both cleaner and resolves the complexity for UI frameworks."

 

My GV was working fine before - was this supposed to be a breaking change, or did my overly difficult UI framework development take an unusual path that no one in their right mind would have imagined?  :)

ajj3085 replied on Wednesday, September 26, 2007

I can't speak to the interface changes, but the new exception is supposed to be a breaking change.  But its a change that alerts you that you are doing databinding incorrectly anyway... so..

I don't know when the 3.0.2 is supposed to "go live."  Perhaps after Rocky releases the new ebook (by EOM I think)?

I've been using the beta for quite a while now, and haven't encountered any problems with it, if tha helps.

Search the forums for EditLevelMismatch.. you'll find many threads around this topic.

As far as putting beta code into production... is it better to ship code with a known defect? Wink [;)]  Something to consider..

casbornsen replied on Wednesday, September 26, 2007

I see your point, but we are not permitted to ship beta at all.  So, we've been doing databinding incorrectly this whole time, eh?  And yet the thing worked... maybe we should just roll back to 2.0 for now.  It would mean we'd be losing the ability to change severity outside the rule, which is very near and dear to our hearts.

ajj3085 replied on Wednesday, September 26, 2007

Well, it could seem like its working, when things really are out of sync.  The exception now tells you things have gone wrong.  It looks like the changes were intoroduced in 3.0, so you should be able to go back to 2.1.4.  I think that one has the other changes you want to keep.  Check the downloads page.

casbornsen replied on Thursday, September 27, 2007

OK, thanks for all your help.  I'll go unscramble my app now.

Copyright (c) Marimer LLC