1

I'm planning to perform apex batch chaining since I will be working on around 3-4 objects with total records probably crossing 50 millions. I'll be doing something similar to this: How to update 2 objects from batch apex

I want to know: Will instantiating the batch class in finish() and performing the batch operation again and again count as a single transaction or, a new transaction will begin every time?

For Ex. if object A has 10000 records,

object B has 20000 records,

object C has 40000 records

At the end of batch operation for Object C, total how many records will be processed in the transaction? - Will it be a single transaction with Database.QueryLocator returning 70000 records? Or, will there be three different transactions with Database.QueryLocator returning 10000 records in 1st, 20000 in second, and 40000 records in 3rd transaction?

2

As you are running a new batch. In batch Processing every execute get a new set of limits and it counts a different transaction.

So all three will be counted as 3 transaction. Also one execute method can process 2000 (max records from query locator) in single transaction. So they also break in chunk of 200(default size). They each will be counted as separate transaction.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.