Exam PDI Topic 5 Question 179 Discussion

Actual exam question for Salesforce's PDI exam
Question #: 179
Topic #: 5
A developer has identified a method in an Apex class that performs resource intensive actions in memory by iterating over the result set of a SOQL statement on the account. The method also performs a DML statement to save the changes to the database.
Which two techniques should the developer implement as a best practice to ensure transaction control and avoid exceeding governor limits'* Choose 2 answers

Suggested Answer: B,D Vote an answer

B: Using partial DML statements (e.g.,Database.insert(list, false)) allows only valid records to be committed while identifying invalid ones, avoiding runtime errors.
D: TheDatabase.Savepointmethod ensures transactional control by allowing rollback to a specific savepoint if an error occurs.
Why not other options?
A: The@ReadOnlyannotation is for read-only operations and would not allow DML operations.
C: TheSystem.Limitclass helps monitor limits but does not directly control transaction behavior.
Best Practices for Apex Transactions

by ken.brill at Jul 04, 2026, 10:00 PM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10