12

I've seen the following values in the AsyncApexJob table during the 'cradle to grave' life cycle of a Batch Apex job:

BEFORE running:

  • Queued
  • Preparing

WHILE running:

  • Processing

AFTER running:

  • Failed
  • Aborted
  • Completed

But I've noticed an additional picklist value that I've never encountered in the wild: Holding. Does anyone have experience with this? Do I need to include this when determining if a batch is running?

picklist-values

5
  • It's not in the docs, so I'd guess it to be a future enhancement, and most likely it would sit between preparing and processing, or a processing state that represents a paused task (eg so other tasks have a chance to run). I'd like to know more.
    – sfdcfox
    May 19, 2014 at 19:31
  • Holding may be the status of a job which would have been executed/executing during a maintenance window and is on hold as a result of that maintenance.
    – Mark Pond
    May 19, 2014 at 20:25
  • For what it's worth. The Holding picklist value appears all the way back to API version 13 (according to Workbench). So it has been around as long as the AsyncApexJob has been in the API. May 20, 2014 at 1:33
  • 1
    The Holding status is mentioned in the Summer 14 release notes under the new pilot feature of "Submit More Batch Jobs with Apex Flex Queue". Summer 14 release site: salesforce.com/customer-resources/releases/summer14.
    – Kevin Lam
    May 23, 2014 at 1:56
  • Thanks @KevinLam - as first in, best dressed, feel free to post your comment as an answer. May 23, 2014 at 9:39

2 Answers 2

14

Based on the Summer '14 Release Notes the holding status appears to be associated with the new Apex Flex Queue feature.

The Apex Flex Queue pilot enables you to submit batch jobs beyond the allowed limit of five queued or active jobs. Any jobs that are submitted for execution but aren’t processed immediately by the system are in holding status and are placed in a separate queue (the Apex flex queue). Up to 100 batch jobs can be in the holding status. When system resources become available, the system picks up jobs from the Apex flex queue and moves them to the batch job queue. The status of these moved jobs changes from Holding to Queued. Queued jobs get executed when the system is ready to process new jobs.

Without administrator intervention, jobs are processed first-in first-out—in the order in which they’re submitted. Administrators can modify the order of jobs that are held in the Apex flex queue to control when they get processed by the system. For example, you can move a batch job up to the first position in the holding queue so that it is the first job that gets processed when the system fetches the next held job from the flex queue.

1
0

The Holding status is mentioned in the Summer 14 release notes under the new pilot feature of "Submit More Batch Jobs with Apex Flex Queue". Summer 14 release site: salesforce.com/customer-resources/releases/summer14.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .