ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 181 - Certified Data Architect discussion

Report
Export

Universal Containers has a rollup summary field on account to calculate the number of contacts associated with an account. During the account load, Salesforce is throwing an 'UNABLE _TO_LOCK_ROW' error.

Which solution should a data architect recommend to resolve the error?

A.
Defer rollup summary field calculation during data migration.
Answers
A.
Defer rollup summary field calculation during data migration.
B.
Perform a batch job in serial mode and reduce the batch size.
Answers
B.
Perform a batch job in serial mode and reduce the batch size.
C.
Perform a batch job in parallel mode and reduce the batch size.
Answers
C.
Perform a batch job in parallel mode and reduce the batch size.
D.
Leverage Data Loader's platform API to load data.
Answers
D.
Leverage Data Loader's platform API to load data.
Suggested answer: B

Explanation:

According to the Salesforce documentation1, the ''UNABLE _TO_LOCK_ROW'' error occurs when a record is being updated or created, and another operation tries to access or update the same record at the same time. This can cause lock contention and timeout issues. To resolve the error, some of the recommended solutions are:

Perform a batch job in serial mode and reduce the batch size (option B). This means running the batch job one at a time and processing fewer records per batch. This can reduce the chances of concurrent updates and lock contention on the same records.

Use the FOR UPDATE keyword to lock records in Apex code or API calls. This means explicitly locking the records that are being accessed or updated by a transaction, and preventing other transactions from modifying them until the lock is released.This can avoid conflicts and errors between concurrent operations on the same records2.

Defer rollup summary field calculation during data migration (option A). This means disabling the automatic calculation of rollup summary fields on the parent object when child records are inserted or updated. This can improve performance and avoid locking issues on the parent records.However, this option is only available for custom objects, not standard objects3.

Performing a batch job in parallel mode and reducing the batch size (option C) is not a good solution, as it can still cause lock contention and errors if multiple batches try to access or update the same records at the same time. Leveraging Data Loader's platform API to load data (option D) is also not a good solution, as it can still encounter locking issues if other operations are modifying the same records at the same time.

asked 23/09/2024
Casey Donovan
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first