I'm aware that you can't call Database.executeBatch
from the execute
method of an already running Batchable
.
But can Database.executeBatch
be called from a Queueable
running via System.enqueueJob
? I'm asking because I'm looking to but an asynchronous layer on top of some code that is already using batchables.
(This Can Queueable solve "Future method cannot be called from a future or batch method"? confirms this works the opposite way round i.e. a Queueable
can be called from a Batchable
.)
PS
Interestingly, while Batchable
-> Batchable
isn't supported, Batchable
-> Queueable
-> Batchable
is, so the Queueable
insulates the pair of Batchable
s from that restriction.