Error in CopyState?

Error in CopyState?

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


ajj3085 posted on Monday, June 01, 2009

Hi,

I have a BB class, and it's getting an excepton when I try to edit it in a grid (it's in a collection, which is also a child of another BO).

The message is ArgumentException: An entry with the same key already exists. when CopyState is called.

I thought this was fixed in a recent Csla version, but I wanted to check it was before I upgrade Csla to fix this.

I'm using the 3.6.3 test version released around 5/19.

Thanks
Andy

RockfordLhotka replied on Monday, June 01, 2009

I remember a bug about this, and using the type name + the field name as a key, going through a while ago, I'm pretty sure it was fixed in 3.6.3.

ajj3085 replied on Tuesday, June 02, 2009

Rocky, this bug still seems to exist, I just upgraded to the Beta 2 version.

My class hiearchy is this:

DiscountLineItem : CalculatedFeeLineItem : NonReparentableLeafNode : LeafNode : LeafContainer : MyBB<LeafContainer>

The Discount and CalcualtedFee classes both contain a private field, SmartDemial lastAmount.

All fields in all levels of this hierarchy are unmanaged.

RockfordLhotka replied on Tuesday, June 02, 2009

You are right - I see the issue. This will (hopefully) be the last fix in
3.6.3 :)

Rocky

ajj3085 replied on Tuesday, June 02, 2009

Whew, I thought it was something I did. Fortunately for me, I think I can proceed, because the field isn't needed in the last subclass, I just didn't remove it.

RockfordLhotka replied on Tuesday, June 02, 2009

If you grab the latest UndoableBase.cs from svn you should be good to go.

Rocky

ajj3085 replied on Tuesday, June 02, 2009

Ok, I'll give it a shot.

ajj3085 replied on Tuesday, June 02, 2009

That fixes it, thanks!

Copyright (c) Marimer LLC