+ Start a Discussion
Arijit Mandal 6Arijit Mandal 6 

Scenario for Batch apex

Let we have to update 500000 record to using batch apex. And after updating 10000 record batch apex fail. mention the process when again batch start running it will start from 10001 number of record with syntax. (Batch apex is schedule from Apex scheduler).
Hopefully i make you understand the question.
Jerome RussJerome Russ
In order to answer the question, it would help to know a bit more. Is there any way to limit the records that you are pulling into the batch? Are you updating the records in the batch where you could check the last updated fields? 

For example, if your batch is updating all records that do not have a certain field populated, you could add that field to the where clause of the initial query. If the batch then updates that field, a restart would automatically bypass all of those records that are already updated.
Arijit Mandal 6Arijit Mandal 6
In a interview recently this question was asked to me...