I have a below batch class where I am passing 100 account ids to the constructor and in the debug logs I can see 100 in constructor as a set size but in start method I can see 0, could someone please suggest
public class batching implements database.Batchable<sObject>, Database.AllowsCallouts {
static set<id> accountIdSet = new set<Id>();
public restCallout(set<id> accountIds) {
accountIdSet = accountIds;
System.debug('size from constructor '+accountIdSet.size());
}
public static database.QueryLocator start(database.BatchableContext bc) {
System.debug('size from start method '+ accountIdSet.size());
return database.getQueryLocator([SELECT Id FROM Account WHERE ID In:accountIdSet ]);
}
public static void execute(database.BatchableContext bc, list<sObject> Scope) {
System.debug('Size from execute '+ Scope.size());
for(Account act: (List<Account>)scope) {
makeACallout();
}
}
public static void finish(database.BatchableContext bc) {
}