I was wondering the following scenario -
- Consider in start method of batch Apex I query all the contacts which are having status = active - Let's assume it will return 50 million records
- Execute method will perform some lengthy operations such that the entire batch job will take some time. Also I'll be updating one field on the contact (say Batch_Processed = True)
- I start the batch job and after execution of start method, I update one contact so that its active = false.
Will this contact record be considered? i.e. after completion of the batch job, will it have Batch_Processed = True?
I couldn't find anything in the documentation related to this. However, I did find a sentence in this link https://developer.salesforce.com/blogs/2019/01/building-a-batch-retry-framework-with-batchapexerrorevent.html
I'm not quite sure - Does it mean that batch job will consider the 'original state' when the start method was executed and ignores the data updates?
- If the above is true, then what would happen if I delete a record which was originally 'considered' by start method? How Salesforce handles this internally?