Error deleting from Azure Cloud Table - ResourceNotFound

后端 未结 3 859
花落未央
花落未央 2021-01-03 08:25

I\'m having an intermittent problem deleting objects from an azure table. It only affects about 1% of my attempts, and if the same call is made again later then it works fin

3条回答
  •  -上瘾入骨i
    2021-01-03 08:44

    By default MergeOption.AppendOnly is used by your tableServiceContext.MergeOption, this means that Azure Table Storage will be tracking your table items. You should detach the item before deleting it, like this:

    tableServiceContext.Detach(messageUnread);
    tableServiceContext.AttachTo(messageTableName, messageUnread, "*");
    tableServiceContext.DeleteObject(messageUnread);
    tableServiceContext.SaveChangesWithRetries();
    

    This should get rid of any item tracking issues.

提交回复
热议问题