我正在调用一个批处理类实例,在完成批处理后,我正在调用另外两个批处理类实例。第一批类的 finish() 方法是
public void finish(Database.BatchableContext BC)
{
List<Event__c> events = [SELECT Id FROM Event__c];
delete events;
System.debug('Executing finish');
for (CalendarSettings__c c: [SELECT Id, Name, CalendarId__c,
CalendarQuery__c, FieldToDisplay__c
FROM CalendarSettings__c])
{
System.debug('Calendar Id is' + c.CalendarId__c);
BatchPublicCampaignsToGoogle bjob = new BatchPublicCampaignsToGoogle(
c.CalendarQuery__c, c.CalendarId__c, c.FieldToDisplay__c);
Database.executeBatch(bjob,9);
}
}
我面临的问题是我期望 Batch 类BatchPublicCampaignsToGoogle
将被调用两次,但它只被调用一次。循环运行了两次(我分析了调试日志)。为什么只调用一次?