ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 179 - Certified Data Architect discussion

Report
Export

Universal Containers (UC) owns a complex Salesforce org with many Apex classes, triggers, and automated processes that will modify records if available. UC has identified that, in its current development state, UC runs change of encountering race condition on the same record.

What should a data architect recommend to guarantee that records are not being updated at the same time?

A.
Embed the keywords FOR UPDATE after SOQL statements.
Answers
A.
Embed the keywords FOR UPDATE after SOQL statements.
B.
Disable classes or triggers that have the potential to obtain the same record.
Answers
B.
Disable classes or triggers that have the potential to obtain the same record.
C.
Migrate programmatic logic to processes and flows.
Answers
C.
Migrate programmatic logic to processes and flows.
D.
Refactor or optimize classes and trigger for maximum CPU performance.
Answers
D.
Refactor or optimize classes and trigger for maximum CPU performance.
Suggested answer: A

Explanation:

According to theHow to avoid row lock or race condition in Apexblog post, one of the ways to prevent race condition in Apex is to use the FOR UPDATE keyword in SOQL statements. The blog post states that ''We need to lock the records on which we are working such that other batches or threads will not be having any effect on them. How can we lock a record, then? We need to make use of FOR UPDATE keyword in the SOQL query.'' Therefore, a data architect should recommend this solution to guarantee that records are not being updated at the same time by different processes.

asked 23/09/2024
JORGE ROCHA
35 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first