In Salesforce, when two concurrent database transactions attempt to perform DML (Data Manipulation Language) operations on related records in a Master-Detail relationship, a row lock conflict can occur. When a parent record (the Master) is locked by one transaction, a second transaction attempting a DML operation on a related child record (the Detail) must wait up to 10 seconds for the lock to be released. This article explains the exact order of execution that occurs during a row lock scenario, and what happens when the lock is not released in time.
Object A and Object B have a Master-Detail relationship. Object A is the Master and Object B is the Detail.
If the lock on Record A is released within 10 seconds: Salesforce acquires the lock on Record A and proceeds with order-of-execution steps 1–15 for Record A.
If the lock on Record A is NOT released within 10 seconds: Salesforce throws the "Unable to lock row — Record currently unavailable" error. The DML operation for Record B is rolled back to the previous savepoint (the state before the update or insert was attempted). Because an exclusive lock on Record A was never obtained, Order of execution steps 1–15 for Record A are also not executed.
000386567

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.