UNABLE_TO_LOCK_ROW error during inserting a new Record
up vote
1
down vote
favorite
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
data access loader
add a comment |
up vote
1
down vote
favorite
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
data access loader
1
Possible duplicate of Can anybody explain the UNABLE_TO_LOCK_ROW error?
– Pranay Jaiswal
6 hours ago
Are you inserting child records? If child cannot get access to parent it throws that error.
– Pranay Jaiswal
6 hours ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
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
data access loader
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
data access loader
data access loader
asked 6 hours ago
Aritra Chakraborty
133
133
1
Possible duplicate of Can anybody explain the UNABLE_TO_LOCK_ROW error?
– Pranay Jaiswal
6 hours ago
Are you inserting child records? If child cannot get access to parent it throws that error.
– Pranay Jaiswal
6 hours ago
add a comment |
1
Possible duplicate of Can anybody explain the UNABLE_TO_LOCK_ROW error?
– Pranay Jaiswal
6 hours ago
Are you inserting child records? If child cannot get access to parent it throws that error.
– Pranay Jaiswal
6 hours ago
1
1
Possible duplicate of Can anybody explain the UNABLE_TO_LOCK_ROW error?
– Pranay Jaiswal
6 hours ago
Possible duplicate of Can anybody explain the UNABLE_TO_LOCK_ROW error?
– Pranay Jaiswal
6 hours ago
Are you inserting child records? If child cannot get access to parent it throws that error.
– Pranay Jaiswal
6 hours ago
Are you inserting child records? If child cannot get access to parent it throws that error.
– Pranay Jaiswal
6 hours ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
5
down vote
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.
bookmarking that cheat sheet posthaste
– Derek F
6 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
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.
bookmarking that cheat sheet posthaste
– Derek F
6 hours ago
add a comment |
up vote
5
down vote
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.
bookmarking that cheat sheet posthaste
– Derek F
6 hours ago
add a comment |
up vote
5
down vote
up vote
5
down vote
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.
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.
edited 6 hours ago
answered 6 hours ago
David Reed
28k61746
28k61746
bookmarking that cheat sheet posthaste
– Derek F
6 hours ago
add a comment |
bookmarking that cheat sheet posthaste
– Derek F
6 hours ago
bookmarking that cheat sheet posthaste
– Derek F
6 hours ago
bookmarking that cheat sheet posthaste
– Derek F
6 hours ago
add a comment |
Thanks for contributing an answer to Salesforce Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f242143%2funable-to-lock-row-error-during-inserting-a-new-record%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Possible duplicate of Can anybody explain the UNABLE_TO_LOCK_ROW error?
– Pranay Jaiswal
6 hours ago
Are you inserting child records? If child cannot get access to parent it throws that error.
– Pranay Jaiswal
6 hours ago