MarkMpn / Sql4Cds

SQL 4 CDS core engine and XrmToolbox tool
MIT License
74 stars 22 forks source link

Error "DeleteMultiple has not yet been implemented" #469

Closed Feb00 closed 2 months ago

Feb00 commented 3 months ago

Only for some tenants, delete queries fail, example: image image

Version 9.0.1 Am I doing something wrong?

MarkMpn commented 3 months ago

What sort of entity is it that you’re using, eg regular, virtual, elastic?

Feb00 commented 3 months ago

Regular entity

MarkMpn commented 3 months ago

This message should only be used on elastic tables, but it sounds like it has been added somehow in the affected tenants for this entity. You can check this by running:

SELECT *
FROM   sdkmessagefilter
       INNER JOIN
       sdkmessage
       ON sdkmessagefilter.sdkmessageid = sdkmessage.sdkmessageid
WHERE  sdkmessagefilter.primaryobjecttypecode = 'xxx_jobqueue'
       AND sdkmessage.name = 'DeleteMultiple';

You should receive 0 records, but in the affected environments I think you will receive 1 result. I'd be interested to understand why this message exists for this entity, but I can work around this in a future update. For now you should be able to avoid the problem by changing the batch size setting to 1, either globally in the SQL 4 CDS settings or by adding the OPTION(USE HINT('BATCH_SIZE_1')) hint for this individual query.

Feb00 commented 3 months ago

I confirm that I get 1 line by running the query in the environments where the problem is present. Setting the batch sizes to 1 the problem does not occur, thank you.