You need to sign in to do that
Don't have an account?
Shiva Rajendran
Does Batch executes sequentially or parallelly?
I want to understand if a batch class with 1million records are run , will it executes 200 records per batch after batch? I mean by , at any point of time only 1 batch of records are executed? or is it like n number of batches of records can run parallelly too?
Want to understand if only 1 batch of records will be locked at any given records or it can be more.
Thanks,
Shiva RV
Want to understand if only 1 batch of records will be locked at any given records or it can be more.
Thanks,
Shiva RV
I want to understand if a batch class with 1million records are run , will it executes 200 records per batch after batch?
Yes -- First 200 then next 200 like this
I mean by , at any point of time only 1 batch of records are executed? or is it like n number of batches of records can run parallelly too?
currently 'execute' methods run sequentially, though the documentation does not make it perfectly clear on this.
Want to understand if only 1 batch of records will be locked at any given records or it can be more.
You can lock by one batch at a time to avoide the issue .. as soon as batch is execute method ix ecuted you will be able to relase the record locking and can able to use by other batch
All Answers
I want to understand if a batch class with 1million records are run , will it executes 200 records per batch after batch?
Yes -- First 200 then next 200 like this
I mean by , at any point of time only 1 batch of records are executed? or is it like n number of batches of records can run parallelly too?
currently 'execute' methods run sequentially, though the documentation does not make it perfectly clear on this.
Want to understand if only 1 batch of records will be locked at any given records or it can be more.
You can lock by one batch at a time to avoide the issue .. as soon as batch is execute method ix ecuted you will be able to relase the record locking and can able to use by other batch
Thanks for the clarity .Just a follow up , i assume if the batch hits the execute method those 200 records are locked till the end of the execute method.
Or is it like those all those 1 million records are locked till the batch completes the finish method?
Because i assumed as the first way but your explaination sounds more like the second way.
Thanks,
Shiva RV
And My Bad ..Batch wnt lock even 200 records in exeucte method if you process 200 by each batch
SO you will get UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 200 records error is same record is access by another batch or process same time
Thanks,
Shiva RV