BLB executing Dataportal_Update with non-dirty objects

BLB executing Dataportal_Update with non-dirty objects

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


pecen posted on Tuesday, August 20, 2013

Hi,

I have a BLB-object (we can call it list) which holds 5 BB-objects. After I have added a new object to the collection I then use list = list.Save(), and it then enters my Dataportal_Update (where I have my base.Child_Update call) for some reason although the first 5 objects haven't been changed or altered in any way. After going through Dataportal_Update for all the first 5 objects, Dataportal_Insert is then executed and the new object is added/written to an Xml-file. Shouldn't Dataportal_Insert be called without first going through Dataportal_Update 5 times, i.e. why are the first 5 objects dirty (IsDirty = true) when they imo actually are not?

Regards

/Peter

JonnyBee replied on Tuesday, August 20, 2013

Hi,

Well - then you must investigate how the objects became Dirty.
Which field or when it actually became Dirty.

F.ex: If you call PropertyHasChanged the object is marked as Dirty.

pecen replied on Wednesday, August 21, 2013

Hi, and thanks.

Sorry, my mistake. Forgot to set using(BypassPropertyChecks) on the Child_Fetch(). I'm just amazed sometimes how much time one can spend looking in the wrong direction. Your answer just made me lift my head and re-think. Thanks again.

/Peter

Copyright (c) Marimer LLC