This is a basic question instead of code related. I am writing a batch job which will update Application__c records. Trigger for Application__c object, enqueues a queueable job to update cases
Batch Job -> Update Application__c -> after update trigger -> queueableJob
A single chunk of batch job will cause 1 queueable job to be spawned from trigger.
From what i understand, each chunk of batch job is considered a separate transaction. So each junk gets that quota of 50 queuable job, am i correct? So i do not have to worry about exceeding the limit of queuable job per transaction? Becuase each junk calls trigger only once, which spawns only 1 queuable job
or does queueable jobs spawned by all the chunks add up to that 50 job limit?
I was pretty sure it's the former scenario (where i dont have to worry about limit). But reading this confused me - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm
Under the section of "Queueable Apex Limits", second bullet point says -
You can add up to 50 jobs to the queue with System.enqueueJob in a single transaction. In asynchronous transactions (for example, from a batch Apex job), you can add only one job to the queue with System.enqueueJob
I assume each chunk of batch job is considered "single transaction" on its own. Reading "Cloud Ninja" response on this post - Error "Too many queueable jobs added to the queue: 2" where he says it is not applicable for batch, you can only enqueue one job threw me off.
So which one is it? Queueable jobs added up together for all the chunks is subject to that 50 job limit? Or queueable jobs spawned by EACH chunk is subject to that 50 job limit?