UNABLE_TO_LOCK_ROW error during inserting a new Record [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1















This question already has an answer here:



  • Can anybody explain the UNABLE_TO_LOCK_ROW error?

    1 answer



I am trying to insert new records in Salesforce using data loader, but getting the below error -
Error received from salesforce.com. Fields . Status code [UNABLE_TO_LOCK_ROW]. Message [unable to obtain exclusive access to this record].



I thought this happens only during update, but why it is happening in Insert










share|improve this question













marked as duplicate by Pranay Jaiswal, battery.cord, Raul, glls, Dave Humm Dec 13 at 9:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Are you inserting child records? If child cannot get access to parent it throws that error.
    – Pranay Jaiswal
    Dec 11 at 14:22















1















This question already has an answer here:



  • Can anybody explain the UNABLE_TO_LOCK_ROW error?

    1 answer



I am trying to insert new records in Salesforce using data loader, but getting the below error -
Error received from salesforce.com. Fields . Status code [UNABLE_TO_LOCK_ROW]. Message [unable to obtain exclusive access to this record].



I thought this happens only during update, but why it is happening in Insert










share|improve this question













marked as duplicate by Pranay Jaiswal, battery.cord, Raul, glls, Dave Humm Dec 13 at 9:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Are you inserting child records? If child cannot get access to parent it throws that error.
    – Pranay Jaiswal
    Dec 11 at 14:22













1












1








1








This question already has an answer here:



  • Can anybody explain the UNABLE_TO_LOCK_ROW error?

    1 answer



I am trying to insert new records in Salesforce using data loader, but getting the below error -
Error received from salesforce.com. Fields . Status code [UNABLE_TO_LOCK_ROW]. Message [unable to obtain exclusive access to this record].



I thought this happens only during update, but why it is happening in Insert










share|improve this question














This question already has an answer here:



  • Can anybody explain the UNABLE_TO_LOCK_ROW error?

    1 answer



I am trying to insert new records in Salesforce using data loader, but getting the below error -
Error received from salesforce.com. Fields . Status code [UNABLE_TO_LOCK_ROW]. Message [unable to obtain exclusive access to this record].



I thought this happens only during update, but why it is happening in Insert





This question already has an answer here:



  • Can anybody explain the UNABLE_TO_LOCK_ROW error?

    1 answer







data access loader






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 11 at 14:19









Aritra Chakraborty

133




133




marked as duplicate by Pranay Jaiswal, battery.cord, Raul, glls, Dave Humm Dec 13 at 9:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Pranay Jaiswal, battery.cord, Raul, glls, Dave Humm Dec 13 at 9:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • Are you inserting child records? If child cannot get access to parent it throws that error.
    – Pranay Jaiswal
    Dec 11 at 14:22
















  • Are you inserting child records? If child cannot get access to parent it throws that error.
    – Pranay Jaiswal
    Dec 11 at 14:22















Are you inserting child records? If child cannot get access to parent it throws that error.
– Pranay Jaiswal
Dec 11 at 14:22




Are you inserting child records? If child cannot get access to parent it throws that error.
– Pranay Jaiswal
Dec 11 at 14:22










1 Answer
1






active

oldest

votes


















5














There are lots of situations where an insert can cause a record lock against the parent of the inserted record, or even against third records. Inserting Task, for example, can lock the WhoId, WhatId, and AccountId.



The Record Locking Cheat Sheet is an excellent guide to what facets of your data have the highest likelihood of lock contention.



Fixing this error is generally heuristic - you need to understand the cause of the underlying issue and then apply one or more techniques to minimize the locking risk, but there's no switch you can throw to make it go away.



The two techniques that are often applicable are



  • Order your incoming data by parent record Id, to prevent records in different batches from contending for the lock on the parent.

  • Ensure that the Data Loader is configured to utilize the Bulk API in Serial mode, rather than Parallel mode.

In many cases (such as when a record has exactly one parent) you won't need to do both, just one or the other. Situations with extreme data skew and records that have more than one parent are more complex, however.



Depending on the situation, it's possible you might have to undertake more drastic interventions, like scheduling a maintenance window to prevent users from themselves seeking to work with affected records, or disabling triggers and other automation on the records you're importing.



Spend some time with the locking cheat-sheet to identify your core issue first, though, and try each of the two points above first before you go that far.






share|improve this answer






















  • bookmarking that cheat sheet posthaste
    – Derek F
    Dec 11 at 14:31

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














There are lots of situations where an insert can cause a record lock against the parent of the inserted record, or even against third records. Inserting Task, for example, can lock the WhoId, WhatId, and AccountId.



The Record Locking Cheat Sheet is an excellent guide to what facets of your data have the highest likelihood of lock contention.



Fixing this error is generally heuristic - you need to understand the cause of the underlying issue and then apply one or more techniques to minimize the locking risk, but there's no switch you can throw to make it go away.



The two techniques that are often applicable are



  • Order your incoming data by parent record Id, to prevent records in different batches from contending for the lock on the parent.

  • Ensure that the Data Loader is configured to utilize the Bulk API in Serial mode, rather than Parallel mode.

In many cases (such as when a record has exactly one parent) you won't need to do both, just one or the other. Situations with extreme data skew and records that have more than one parent are more complex, however.



Depending on the situation, it's possible you might have to undertake more drastic interventions, like scheduling a maintenance window to prevent users from themselves seeking to work with affected records, or disabling triggers and other automation on the records you're importing.



Spend some time with the locking cheat-sheet to identify your core issue first, though, and try each of the two points above first before you go that far.






share|improve this answer






















  • bookmarking that cheat sheet posthaste
    – Derek F
    Dec 11 at 14:31















5














There are lots of situations where an insert can cause a record lock against the parent of the inserted record, or even against third records. Inserting Task, for example, can lock the WhoId, WhatId, and AccountId.



The Record Locking Cheat Sheet is an excellent guide to what facets of your data have the highest likelihood of lock contention.



Fixing this error is generally heuristic - you need to understand the cause of the underlying issue and then apply one or more techniques to minimize the locking risk, but there's no switch you can throw to make it go away.



The two techniques that are often applicable are



  • Order your incoming data by parent record Id, to prevent records in different batches from contending for the lock on the parent.

  • Ensure that the Data Loader is configured to utilize the Bulk API in Serial mode, rather than Parallel mode.

In many cases (such as when a record has exactly one parent) you won't need to do both, just one or the other. Situations with extreme data skew and records that have more than one parent are more complex, however.



Depending on the situation, it's possible you might have to undertake more drastic interventions, like scheduling a maintenance window to prevent users from themselves seeking to work with affected records, or disabling triggers and other automation on the records you're importing.



Spend some time with the locking cheat-sheet to identify your core issue first, though, and try each of the two points above first before you go that far.






share|improve this answer






















  • bookmarking that cheat sheet posthaste
    – Derek F
    Dec 11 at 14:31













5












5








5






There are lots of situations where an insert can cause a record lock against the parent of the inserted record, or even against third records. Inserting Task, for example, can lock the WhoId, WhatId, and AccountId.



The Record Locking Cheat Sheet is an excellent guide to what facets of your data have the highest likelihood of lock contention.



Fixing this error is generally heuristic - you need to understand the cause of the underlying issue and then apply one or more techniques to minimize the locking risk, but there's no switch you can throw to make it go away.



The two techniques that are often applicable are



  • Order your incoming data by parent record Id, to prevent records in different batches from contending for the lock on the parent.

  • Ensure that the Data Loader is configured to utilize the Bulk API in Serial mode, rather than Parallel mode.

In many cases (such as when a record has exactly one parent) you won't need to do both, just one or the other. Situations with extreme data skew and records that have more than one parent are more complex, however.



Depending on the situation, it's possible you might have to undertake more drastic interventions, like scheduling a maintenance window to prevent users from themselves seeking to work with affected records, or disabling triggers and other automation on the records you're importing.



Spend some time with the locking cheat-sheet to identify your core issue first, though, and try each of the two points above first before you go that far.






share|improve this answer














There are lots of situations where an insert can cause a record lock against the parent of the inserted record, or even against third records. Inserting Task, for example, can lock the WhoId, WhatId, and AccountId.



The Record Locking Cheat Sheet is an excellent guide to what facets of your data have the highest likelihood of lock contention.



Fixing this error is generally heuristic - you need to understand the cause of the underlying issue and then apply one or more techniques to minimize the locking risk, but there's no switch you can throw to make it go away.



The two techniques that are often applicable are



  • Order your incoming data by parent record Id, to prevent records in different batches from contending for the lock on the parent.

  • Ensure that the Data Loader is configured to utilize the Bulk API in Serial mode, rather than Parallel mode.

In many cases (such as when a record has exactly one parent) you won't need to do both, just one or the other. Situations with extreme data skew and records that have more than one parent are more complex, however.



Depending on the situation, it's possible you might have to undertake more drastic interventions, like scheduling a maintenance window to prevent users from themselves seeking to work with affected records, or disabling triggers and other automation on the records you're importing.



Spend some time with the locking cheat-sheet to identify your core issue first, though, and try each of the two points above first before you go that far.







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 11 at 14:33

























answered Dec 11 at 14:24









David Reed

29.3k61746




29.3k61746











  • bookmarking that cheat sheet posthaste
    – Derek F
    Dec 11 at 14:31
















  • bookmarking that cheat sheet posthaste
    – Derek F
    Dec 11 at 14:31















bookmarking that cheat sheet posthaste
– Derek F
Dec 11 at 14:31




bookmarking that cheat sheet posthaste
– Derek F
Dec 11 at 14:31


Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay