Salesforce Data Management25% of the exam
Consistent writes: transactions, locking and upsert keys
How the platform keeps writes consistent: transaction boundaries, savepoints and partial-success DML, FOR UPDATE locks, the save order of execution, post-commit work, External ID upserts, Composite allOrNone, mixed DML, formula fields and global value sets.
Given a customer scenario, recommend techniques to ensure data is persisted in a consistent manner.
~8 min read · 20 practice questions ·
What the exam expects
- Keep related writes all-or-nothing with savepoints, Database methods, Composite allOrNone and mixed-DML separation.
- Stop lost updates under concurrency with
FOR UPDATE, and explain how its locks behave. - Place a validation rule, flow, trigger or roll-up in the order of execution and predict what fails.
- Send notifications only after commit, and make integration retries idempotent with External ID + Unique upserts.
- Keep values consistent with formula fields, restricted picklists and global value sets.
Key terms: transaction (all DML in one request, committed or rolled back together); savepoint (a marked database state to roll back to); partial success (Database methods with allOrNone false); External ID (a field holding another system's key); post-commit logic (work that runs only after the commit).
Key facts
Rollback to an earlier savepoint
- Detail
- Later savepoints become invalid; using one is a runtime error
Static variables
- Detail
- Not reverted by rollback or partial-success retries
Partial-success edges
- Detail
- An invalid value set by a before trigger stops the partial insert; SOAP retries unfailed records up to three times, then fails the call
Locking query limits
- Detail
- No
ORDER BY; a waiting client gives up after 10 seconds; callouts release locks
REST conditional update
- Detail
If-Unmodified-Sincereturns 412 Precondition Failed if the record changed (ETag/If-Match: Account only)
Composite request
- Detail
- Up to 25 subrequests in one API call
Database method default
- Detail
allOrNoneis true unless you pass false
FOR UPDATE lock- Detail
- Others can query, not update; released at transaction end
Multiple triggers, same event
- Detail
- Firing order isn't guaranteed
Upsert key matched twice
- Detail
- Error; record neither inserted nor updated
Sources for this section (9)
- Transaction Controldeveloper.salesforce.com (opens in a new tab)
- Triggers and Order of Executiondeveloper.salesforce.com (opens in a new tab)
- Bulk DML Exception Handlingdeveloper.salesforce.com (opens in a new tab)
- Locking Statementsdeveloper.salesforce.com (opens in a new tab)
- Conditional Request Headersdeveloper.salesforce.com (opens in a new tab)
- Send Multiple Requests Using Compositedeveloper.salesforce.com (opens in a new tab)
- DML Statements vs. Database Class Methodsdeveloper.salesforce.com (opens in a new tab)
- Key Remindershelp.salesforce.com (opens in a new tab)
- Upserting Recordsdeveloper.salesforce.com (opens in a new tab)
- Why does a caught exception leave orphaned parent records?
- When should an integration mark its External ID field Unique too?
- Which field type keeps a parent's value current on millions of children without updates?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the Platform Data Architect pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 21 lessons of the Platform Data Architect guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Inline practice questions and one-click topic practice (20 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Unlimited timed practice exams