nerdexam
Salesforce

CRT-450 · 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…

The correct answer is B. Use the System,Limit classto monitor the current CPU governor limit consumption. C. Use the Database,Savepoint method to enforce database integrity. See the full explanation below for the reasoning.

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.

How the community answered

(52 responses)
  • A
    8% (4)
  • B
    79% (41)
  • D
    13% (7)

Community Discussion

No community discussion yet for this question.

Full CRT-450 Practice