A row-lock error (UNABLE_TO_LOCK_ROW — "unable to obtain exclusive access to this record") means a transaction tried to update a Salesforce record that another transaction was already holding, and the lock was not released within Salesforce's roughly 10-second wait window. During bulk data loads it is the single most common cause of partial loads: parallel batches touch the same parent records and fail in waves. The fix is rarely exotic — run the load in serial mode or smaller batches, sort records by parent ID, quiet down automation and scheduled jobs during the load window, and retry the failed rows once the org is idle. This guide is for admins, developers, and consultants planning or rescuing a Salesforce data load, and it explains how Vantage Point's integration and data migration team approaches load design so row locks stop being a surprise.
Salesforce is a multi-tenant database, and it protects record integrity with locks. When a transaction creates or updates a record, Salesforce places a lock on that record — and often on related records, such as the parent Account when a child Task is inserted — until the transaction commits. A second transaction that needs the same record waits for the lock. If the wait exceeds roughly 10 seconds, Salesforce throws UNABLE_TO_LOCK_ROW and rolls the waiting transaction back.
Three properties of this error matter for planning:
In day-to-day use, row locks are rare because humans rarely edit the same record within the same 10 seconds. Data loads break that assumption in four ways:
| Cause | How it happens | First fix to try |
|---|---|---|
| Parallel Bulk API batches | Two batches contain rows sharing a parent or related record and lock it simultaneously. | Switch to serial mode; sort the file by parent ID. |
| Apex triggers and flows | Automation on the child or parent extends lock time past the 10-second window. | Reduce trigger execution time; deactivate non-essential automation for the load window. |
| Master-detail and lookup locks | Child DML locks the parent; roll-up summary fields force parent recalculation. | Group child rows by parent; consider loading in parent-sized chunks. |
| Sharing recalculation | Ownership changes or group updates trigger sharing recalcs that lock records and roles. | Defer sharing rule recalculation until after the load. |
| Concurrent jobs and users | Scheduled Apex, integrations, Email-to-Case, or users editing records during the load. | Load off-hours; pause scheduled jobs; freeze integrations temporarily. |
Salesforce's own row-lock error documentation walks through the same scenarios from the support side, including Email-to-Case and Apex trigger examples.
When a load comes back with thousands of row-lock failures, resist the urge to rerun the whole file. Work this sequence instead:
Abort the job. Every additional parallel attempt adds more contention and more interleaved partial success, which makes reconciliation harder.
Pull the success and error files from the job. The failed file is your new input file — never reload rows that already committed, or you will trade lock errors for duplicates.
Row-lock errors are retryable; validation errors, missing required fields, and malformed IDs are not. If the error file mixes types, separate them. Only the lock failures go into the retry file.
Check Setup for running scheduled jobs, pause non-critical flows and integrations, and pick a window when users are offline. If a specific scheduled job overlaps the load every time, that is your lock partner.
Reload the retry file serially — one batch at a time — with a reduced batch size. Sort by parent record ID first so any remaining contention is inside a single batch, where Salesforce serializes it for you.
Compare source counts, committed counts, and remaining errors object by object. A load is done when every source row is accounted for, not when the job finishes.
Rescue is expensive; prevention is cheap. Salesforce's Bulk API planning guidelines and hard-won migration practice point to the same checklist:
The same error shows up in steady-state orgs: Email-to-Case colliding with triggers on the parent Account, integrations updating records a user is editing, or scheduled flows overlapping business hours. The triage is identical — find the competing transaction with debug logs, shorten it, or reschedule it. If row locks appear in normal operations, that is a signal the automation architecture needs review, not just the load plan.
Inventory where your org is exposed: heavy master-detail hierarchies, always-on integrations, scheduled jobs that touch the same objects you load into, and triggers that have never been timed. Then adopt the prevention checklist as a standard pre-load gate, and keep the rescue sequence documented so a failed load at 11 p.m. is a procedure, not a panic. If your team runs loads only occasionally, treat the first production-sized load as a rehearsal with a rollback plan and a retry file format agreed in advance.
Vantage Point's senior consultants design and rescue Salesforce data loads as part of system integration and data migration engagements — from file preparation and load sequencing to automation quieting and post-load reconciliation. For orgs that hit row locks in day-to-day operations, our managed services team reviews trigger and flow performance, scheduled-job conflicts, and integration timing so the locks stop recurring. Senior consultants only — no junior handoffs; the experts you meet are the experts who deliver.
If a migration or integration load is on your calendar, Vantage Point can review the load plan — file ordering, batch mode, automation window, retry procedure — before it runs, or step in when a load has already failed. Contact Vantage Point to schedule a working session, or explore our data migration services to see how we run loads that reconcile to the row.
It means a transaction tried to create or update a record that another transaction had already locked, and the lock was not released within roughly 10 seconds. Salesforce rolls back the waiting transaction and returns the error. The record itself is not corrupted — the operation simply lost a race and can almost always be retried.
Because bulk loads break the normal pattern of record access. Parallel batches, parent-record locking on child inserts, and automation running inside every transaction put far more simultaneous demand on the same records than human users ever do. The load is not creating a new problem so much as exposing contention that normal usage never triggers.
Usually, yes. Serial mode processes one batch at a time, which removes cross-batch contention — the most common cause of lock failures in loads. The trade-off is speed: serial loads run slower, so teams typically reserve serial mode for contention-heavy objects like activities and notes, and keep parallel mode for independent records.
There is no universal number — start with your tool's default and reduce it when locks appear, because smaller batches hold locks for less time and collide less often. Combine smaller batches with sorting the file by parent record ID, which matters more than the raw batch size in most orgs.
Yes. Triggers and record-triggered flows run inside the transaction and extend how long locks are held. A trigger that takes several seconds turns every record it touches into a lock hotspot, and flows that update parent records create the same contention parallel batches do. Deactivating non-essential automation during a load window is a standard prevention step.
Not immediately, and not with the same settings. Retry only the failed rows — never the whole file — after you have removed the contention source: switch to serial mode, shrink batches, sort by parent ID, and confirm no scheduled job or integration is running. Retrying the full file in parallel usually reproduces the same failures.
Enable debug logs around the load window and look for long-running triggers, flows, and scheduled Apex that overlap the failures. Check Setup for scheduled jobs and paused or failed flow interviews at the same timestamps. Tools that surface job history help, but the correlation of failure timestamps with other running processes is what identifies the lock partner.
Vantage Point is a boutique CRM consulting firm helping businesses transform with Salesforce, HubSpot, and AI. Learn more at vantagepoint.io.