Error: UNABLE_TO_LOCK_ROW: Unable to Obtain Exclusive Access to This Record
Issue
While syncing data to a Salesforce destination, records are rejected with the following message:
UNABLE_TO_LOCK_ROW: unable to obtain exclusive access to this record or 200 records
Environment
Activations destination: Salesforce
Resolution
This error is often temporary. To resolve this issue, first retry the sync:
- In Fivetran, go to the affected activation sync overview page.
- Select the Sync History tab.
- In the History chart, confirm that the rejected records failed with the
UNABLE_TO_LOCK_ROWerror. - In the top right, click Run Now.
If the error persists, reduce the sync batch size:
- On the sync's overview page, select the Overview tab.
- Go to Advanced > Batch Size, then click Edit.
- Enter a smaller batch size, then click Update.
- Click Run Now.
Setting a smaller batch size sends fewer records to Salesforce at once. This can reduce record-locking conflicts and improve sync performance.
If the issue persists, check whether Apex triggers, flows, process builders, or scheduled jobs on the target Salesforce object update the same records during the same time window.
Cause
Salesforce requires an exclusive lock on records to update them. We send records in batches, and Salesforce may split those batches into smaller transactions. This issue occurs when another user, trigger, flow, job, or process is already updating the same records. When this happens, Salesforce rejects our update with the UNABLE_TO_LOCK_ROW error.