Skip to content

Commit

Permalink
Standardised checking for missing records on UPDATE/DELETE
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Sep 15, 2024
1 parent 3324c5f commit 0ea9df9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion MarkMpn.Sql4Cds.Engine/ExecutionPlan/DeleteNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ protected override bool FilterErrors(NodeExecutionContext context, OrganizationR
{
// Ignore errors trying to delete records that don't exist - record may have been deleted by another
// process in parallel.
return fault.ErrorCode != -2147220891 && fault.ErrorCode != -2147185406 && fault.ErrorCode != -2147220969 && fault.ErrorCode != 404;
return fault.ErrorCode != -2147185406 && // IsvAbortedNotFound
fault.ErrorCode != -2147220969 && // ObjectDoesNotExist
fault.ErrorCode != 404; // Elastic tables
}

protected override ExecuteMultipleResponse ExecuteMultiple(DataSource dataSource, IOrganizationService org, EntityMetadata meta, ExecuteMultipleRequest req)
Expand Down
4 changes: 3 additions & 1 deletion MarkMpn.Sql4Cds.Engine/ExecutionPlan/UpdateNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,9 @@ protected override bool FilterErrors(NodeExecutionContext context, OrganizationR
{
// Ignore errors trying to update records that don't exist - record may have been deleted by another
// process in parallel.
return fault.ErrorCode != -2147220969 && fault.ErrorCode != -2147185406 && fault.ErrorCode != -2147220969 && fault.ErrorCode != 404;
return fault.ErrorCode != -2147185406 && // IsvAbortedNotFound
fault.ErrorCode != -2147220969 && // ObjectDoesNotExist
fault.ErrorCode != 404; // Elastic tables
}

protected override ExecuteMultipleResponse ExecuteMultiple(DataSource dataSource, IOrganizationService org, EntityMetadata meta, ExecuteMultipleRequest req)
Expand Down

0 comments on commit 0ea9df9

Please sign in to comment.