DATA-ARCHITECT practice question 5 of 35

Universals Containers’ system administrators have been complaining that they are not able to make changes to its users’ record, including moving them to new territories without getting “unable to lock row” errors. This is causing the system admins to spend hours updating user records every day. What should the data architect do to prevent the error?

Full set: 257 questions
Answer options
A: Reduce number of users updated concurrently.
B: Enable granular locking. Correct answer
C: Analyze Splunk query to spot offending records.
D: Increase CPU for the Salesforce org.
Correct Answer:
B. Enable granular locking.
Explanation

The "unable to lock row" error during user record updates, especially when changing roles or territories, is a classic symptom of record lock contention caused by sharing rule recalculations. When a user's position in the hierarchy changes, Salesforce must recalculate access for all records they own. If a user owns many records, this process can be lengthy, locking the User object and preventing other updates. Enabling "granular locking" is the specific platform feature designed to resolve this. It allows the system to lock only parts of the internal sharing tables instead of the entire table, significantly reducing contention and allowing concurrent updates to succeed.

Why Incorrect

A. Reducing concurrent updates is a temporary workaround that reduces the likelihood of the error but does not solve the underlying cause of the long-running lock.
C. Analyzing logs might help identify the problem, but it is a diagnostic step, not a solution. The solution is a specific Salesforce configuration change.
D. Customers cannot directly increase CPU for their Salesforce org. This is managed by Salesforce, and the issue is lock contention, not a lack of processing power.

References

1. Salesforce Help, "Enable Granular Locking": "To avoid user record locking issues, enable granular locking. When this feature is on, user record updates in different roles aren’t blocked by updates to user records in other parts of the role hierarchy."

2. Salesforce Developer Blog, "Record Locking Cheatsheet": Explains the causes of record locking. "Implicit Locks: Salesforce applies locks to other records that are related to the records you’re updating. For example, updating a user’s role will lock the user’s record..."

3. Salesforce Architects, "Designing Record Access for Enterprise Scale" (White Paper), Page 23: "When you perform updates to the role hierarchy... Salesforce locks a portion of the group maintenance tables to prevent other updates at the same time... you can request that Salesforce enable granular locking on your group maintenance tables."

Scroll to Top