Database.upsert() Lock Errors: The Silent Failure Pattern
When Database.upsert() encounters UNABLE_TO_LOCK_ROW, the error appears in UpsertResult objects — not as an exception. Without explicit handling, lock contention silently drops records.
When Database.upsert() encounters UNABLE_TO_LOCK_ROW, the error appears in UpsertResult objects — not as an exception. Without explicit handling, lock contention silently drops records.
How Database.upsert() with external ID fields prevents duplicate record creation in concurrent integration scenarios, and when additional concurrency controls are needed.
How concurrent Queueable jobs create race conditions that lead to duplicate records, and how FOR UPDATE locking, External ID Upsert, and dedup queries provide defense-in-depth.