PDI · Question #101
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
Sign in or unlock PDI to reveal the answer and full explanation for question #101. The question stem and answer options stay visible for context.
Question
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 datadase. Which two techniques should the developer implement as a best practice to ensure transaction control and avoid exceeding governor limits? Choose 2 answers
Options
- AUse partial DML statements to ensure only valid data is committed.
- BUse the System,Limit classto monitor the current CPU governor limit consumption.
- CUse the Database,Savepoint method to enforce database integrity.
- DUse the Reedonly annotation to bypass the number of rows returned by a SOQL.
Unlock PDI to see the answer
You've previewed enough free PDI questions. Unlock PDI for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.