"Fields collection for UPDATE command is empty" error when using SendReducedDelta

Hello,

I’m writing a process for which, after careful consideration, I need to use a reduced delta. For updating the entity, I do something like:

MyDomainService.ProcessEntity(myEntity);
Repository.Save(myEntity);  // this calls lda.Update(myEntity_oldValues, myEntity)
Repository.ApplyChanges();

The “ProcessEntity” method might or might not change the myEntity, as I need the process to be idempotent, but if I don’t change the entity, and I Save/ApplyUpdates, I get the error at the server “Fields collection for UPDATE command is empty”. Looking at the delta received, I see I only receive the Primary_Key field and the rest of values (old and new) are null. This, of course, generates the error.

My question is: shouldn’t the LinqDataAdapter realize that there is nothing to update and simply not call the server with an empty delta?

I know I can (and will) add a check in the Save method to avoid sending an empty update, but since the LinqDataAdapter already has a process for generating the delta, it should be the one with the check for empty updates. Or is there already a way to check for this? Adding a manual check is tedious and too much extra code, :slight_smile:.

Thanks,
Arturo.

Thanks, logged as bugs://82561

Hello

Unfortunately I was not able to reproduce the issue. Could you create a testcase or at least provide code that triggers this issue and the Schema definition of the table involved?

You can send them to support@ if you do not want to expose them in public.

Thanks in advance

bugs://82561 got closed with status cannotrepro.