Closed Feb00 closed 2 months ago
What sort of entity is it that you’re using, eg regular, virtual, elastic?
Regular entity
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.
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.
Only for some tenants, delete queries fail, example:
![image](https://github.com/MarkMpn/Sql4Cds/assets/66962235/e4f118ae-3a57-498f-b282-e6e462d9edb2)
Version 9.0.1 Am I doing something wrong?