Skip to content

Commit

Permalink
Do not attempt to use CreateMultiple or UpdateMultiple for virtual ta…
Browse files Browse the repository at this point in the history
…bles

Fixes #541
  • Loading branch information
MarkMpn committed Sep 8, 2024
1 parent 6a39195 commit f40e048
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MarkMpn.Sql4Cds.Engine/ExecutionPlan/InsertNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ protected override ExecuteMultipleResponse ExecuteMultiple(DataSource dataSource
if (!req.Requests.All(r => r is CreateRequest))
return base.ExecuteMultiple(dataSource, org, meta, req);

if (meta.DataProviderId == DataProviders.ElasticDataProvider || dataSource.MessageCache.IsMessageAvailable(meta.LogicalName, "CreateMultiple"))
if (meta.DataProviderId == DataProviders.ElasticDataProvider || meta.DataProviderId == null && dataSource.MessageCache.IsMessageAvailable(meta.LogicalName, "CreateMultiple"))
{
// Elastic tables can use CreateMultiple for better performance than ExecuteMultiple
var entities = new EntityCollection { EntityName = meta.LogicalName };
Expand Down
2 changes: 1 addition & 1 deletion MarkMpn.Sql4Cds.Engine/ExecutionPlan/UpdateNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ protected override ExecuteMultipleResponse ExecuteMultiple(DataSource dataSource
if (!req.Requests.All(r => r is UpdateRequest))
return base.ExecuteMultiple(dataSource, org, meta, req);

if (meta.DataProviderId == DataProviders.ElasticDataProvider || dataSource.MessageCache.IsMessageAvailable(meta.LogicalName, "UpdateMultiple"))
if (meta.DataProviderId == DataProviders.ElasticDataProvider || meta.DataProviderId == null && dataSource.MessageCache.IsMessageAvailable(meta.LogicalName, "UpdateMultiple"))
{
// Elastic tables can use UpdateMultiple for better performance than ExecuteMultiple
var entities = new EntityCollection { EntityName = meta.LogicalName };
Expand Down

0 comments on commit f40e048

Please sign in to comment.