exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 96 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 96
Topic #: 1
[All Certified Platform Developer II Questions]

1 Contact con = new Contact( LastName ='Smith', Department = 'Admin')
2 insert con;
3 Contact insertedContact=[select Name from Contact where id=:con.Id];
4 Savepoint sp_admin = Database.setSavepoint();
5 con.Department = 'HR';
6 update con;
7 Database.rollback(sp_admin);
8 System.debug(Limits.getDmlStatements());
Given the following code, what value will be output in the logs by line #8?

  • A. 5
  • B. 3
  • C. 4
  • D. 2
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Liquad
Highly Voted 1 year, 12 months ago
setSavePoint and rollback are two dmls.
upvoted 6 times
...
santo_aj
Most Recent 2 months, 4 weeks ago
Selected Answer: C
Calls to the following methods count against the number of DML statements issued in a request. Approval.process Database.convertLead Database.emptyRecycleBin Database.rollback Database.setSavePoint delete and Database.delete insert and Database.insert merge and Database.merge undelete and Database.undelete update and Database.update upsert and Database.upsert EventBus.publish for platform events configured to publish after commit System.runAs
upvoted 2 times
...
lorenac2
7 months, 3 weeks ago
Selected Answer: C
Refer to point #2 below the table: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm
upvoted 2 times
...
drwebber
1 year, 8 months ago
Selected Answer: C
Contact con = new Contact( LastName ='Smith', Department = 'Admin'); insert con; Contact insertedContact=[select Name from Contact where id=:con.Id]; Savepoint sp_admin = Database.setSavepoint(); con.Department = 'HR'; update con; Database.rollback(sp_admin); System.debug('statements: ' + Limits.getDmlStatements()); // returns 4
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago