I have a batch where I first query some ContentDocumentLink. If the query has some results, I got an internal Salesforce.com Error when the batch start during the SerialBatchApexRangeChunkHandler operation. Here is the code :
global class BATCH_ContentDocumentLink implements Database.Batchable < sObject > {
String query;
global BATCH_ContentDocumentLink() {
query = 'SELECT ContentDocumentId FROM ContentDocumentLink ' +
'WHERE LinkedEntityId IN (SELECT Id FROM User)';
}
global Database.QueryLocator start(Database.BatchableContext BC) {
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, List < sObject > scope) {
System.debug(scope);
}
global void finish(Database.BatchableContext BC) {
}
}
What is the issue ?