New but deleted items accumulate indefinitely in BusinessListBase?

New but deleted items accumulate indefinitely in BusinessListBase?

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


rsbaker0 posted on Wednesday, March 04, 2009

I'm finding that new items added to a BLB that are then deleted tend to remain around for the life of the object.

"Saving" the BLB will clear the DeletedList, but only if list reports itself to be dirty via IsDirty. Otherwise, the Save() process is bypassed. However, new items on the DeletedList don't by themselves cause IsDirty to be true.

Is there are recommended approach for handling this? At this point, I think the only real impact is temporary object bloat.

Without looking into it too deeply, I'd suggest that perhaps ApplyEdit should remove such items.

ajj3085 replied on Thursday, March 05, 2009

This would probably only be a problem if the user is editing the same object all day and hitting save each time.. but never closing out the editor.  I'd find that to be a pretty unlikely scenario. 

Also, doesn't the list report that it's dirty if there are ANY items in DeletedList?  Maybe it's changed, but I thought that's how it was working.

rsbaker0 replied on Friday, March 06, 2009

I agree that it's unlikely to actually cause any problems in practice, except for confusion it causes the developer when they see edit level tracing output for child objects that should be long gone... :)

The CSLA code I have (3.5.2) reports dirty only if there is an item on the deleted list that is "old".

Copyright (c) Marimer LLC