You need to sign in to do that
Don't have an account?
Archit Budhraja 7
Encountering "TooManyLockFailure" error repeatedly in Bulk Data Load jobs
We have several jobs scheduled to run every 30 minutes that either update or upsert information from our Data Warehouse into Salesforce. These jobs run using the Bulk API in parallel mode. A lot of these jobs have had batches that have been failing repeatedly with the following error -
Error: Batch 751a0000007HacXAAS of job 750a0000003Y1X6AAK failed: InternalServerError : Retried more than 10 times;
TooManyLockFailure : Too many lock failure 199 Trying again later.;
TooManyLockFailure : Too many lock failure 199 Trying again later.;
TooManyLockFailure : Too many lock failure 199 Trying again later.;
TooManyLockFailure : Too many lock failure 197 Trying again later.;
TooManyLockFailure : Too many lock failure 198 Trying again later.;
TooManyLockFailure : Too many lock failure 194 Trying again later.;
TooManyLockFailure : Too many lock failure 196 Trying again later.;
TooManyLockFailure : Too many lock failure 199 Trying again later.;
TooManyLockFailure : Too many lock failure 199 Trying again later.;
TooManyLockFailure : Too many lock failure 200 Trying again later.
As a result, we end up having bad/missing data in Salesforce. I'm struggling to diagnose what exactly is causing this issue, any help here would be appreciated. Thanks!
Error: Batch 751a0000007HacXAAS of job 750a0000003Y1X6AAK failed: InternalServerError : Retried more than 10 times;
TooManyLockFailure : Too many lock failure 199 Trying again later.;
TooManyLockFailure : Too many lock failure 199 Trying again later.;
TooManyLockFailure : Too many lock failure 199 Trying again later.;
TooManyLockFailure : Too many lock failure 197 Trying again later.;
TooManyLockFailure : Too many lock failure 198 Trying again later.;
TooManyLockFailure : Too many lock failure 194 Trying again later.;
TooManyLockFailure : Too many lock failure 196 Trying again later.;
TooManyLockFailure : Too many lock failure 199 Trying again later.;
TooManyLockFailure : Too many lock failure 199 Trying again later.;
TooManyLockFailure : Too many lock failure 200 Trying again later.
As a result, we end up having bad/missing data in Salesforce. I'm struggling to diagnose what exactly is causing this issue, any help here would be appreciated. Thanks!
Please follow below links:
https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_reference_errors.htm
https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_planning_guidelines.htm
Regards,
Mahesh
http://amitsalesforce.blogspot.in/2015/03/locking-statements-for-update.html
In your case please change the Size in your data loader to 1 that will resolve your issue.
https://developer.salesforce.com/page/Loading_Large_Data_Sets_with_the_Force.com_Bulk_API
Let us know if this will help you
Thanks
Amit Chaudhary
I'm already use FOR UPDATE in my triggers to lock records for editing. Also, I am not using the Data Loader to load data, so I can't set the batch size. I am doing it through a python script that uses a library called salesforce_bulk to load data from our data warehouse into Salesforce.
@Mahesh - I have already gone through those documents, they didn't really help me figure out what exactly is causing the issue.
Whenever a reference field (lookup field) is accessed by 1 batch, it locks the record and if the same lookup value is getting accessed in another batch (which is highly likely to happen), it starts gives locking errors.
One way to prevent this error can be to sort the records by the reference id field so that the same values can be in a single batch and this will limit the scenario of getting the same reference id value in another batch.
For example, if you are loading contacts, then sort the data on account id.
I hope this helps.
Regards
Sumit
sumit@celebal.com