• Jerry Swartz
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I have a set of records, 4119, for which I want to do some batch processing.  I have developed a class and executed my batch using a batch size of 15 and later a batch size of 10.

During execution, I can monitor progress on the Apex Jobs page.  Using a batch size of 10, I can see the Total Batches displays as 411.  During the course of execution, the Total Batches stays at 411 a few times while the Batches Processed increases.  However, at the 10th batch processed, the number of Total Batches shrinks to, 401.  After a few more, it shrinks to 391, and so on.  For example:

Some iterations as viewed in Apex Jobs:

Total Batches/Batches Processed
411/0
411/9
401/10
391/15
391/16
381/18
381/19
381/20
371/21

Eventually, the batch "finishes" but at the end, only a portion of the records have been processed.  It seems as though batches are lost somewhere along the way.  I don't see any failures in my debug logs and the Apex job shows no failures.  Where it started with 411, it might end up at 93 Total Batches/93 Batches Processed.  Based upon my particular logic and processing of the original 4119 records, I can tell they all haven't been touched.

Does anyone have an explanation for this or suggestions how to troubleshoot what's going on?  I reduced my batch size from 15 to 10 thinking maybe something was hitting a limit, but as noted, I never see evidence of this.
 
I have a set of records, 4119, for which I want to do some batch processing.  I have developed a class and executed my batch using a batch size of 15 and later a batch size of 10.

During execution, I can monitor progress on the Apex Jobs page.  Using a batch size of 10, I can see the Total Batches displays as 411.  During the course of execution, the Total Batches stays at 411 a few times while the Batches Processed increases.  However, at the 10th batch processed, the number of Total Batches shrinks to, 401.  After a few more, it shrinks to 391, and so on.  For example:

Some iterations as viewed in Apex Jobs:

Total Batches/Batches Processed
411/0
411/9
401/10
391/15
391/16
381/18
381/19
381/20
371/21

Eventually, the batch "finishes" but at the end, only a portion of the records have been processed.  It seems as though batches are lost somewhere along the way.  I don't see any failures in my debug logs and the Apex job shows no failures.  Where it started with 411, it might end up at 93 Total Batches/93 Batches Processed.  Based upon my particular logic and processing of the original 4119 records, I can tell they all haven't been touched.

Does anyone have an explanation for this or suggestions how to troubleshoot what's going on?  I reduced my batch size from 15 to 10 thinking maybe something was hitting a limit, but as noted, I never see evidence of this.