This
Question even nudges you to think about some 10k limit
And try/catch shouldn't be used with DML exceptions
https://www.crmscience.com/single-post/2020/05/20/how-salesforce-developers-handle-errors-with-try-catch-rollback-best-practices
SOQL can retrieve 50.000 records.
The org has only 10.000 records.
The records are placed inside a list.
Then the entire list is updated. So DML count is 1/150.
I would go with the C:
System.LimitException: Too many DML rows: 10001 is DmlException that is thrown by the Database.update statement! In a try-catch block the exception is handled (DmlException extends Exception)
In this example, the code updates 50,000 Case records, which exceeds the limit of 10,000 records per DML statement. Therefore, the transaction will fail due to exceeding the governor limit, and an exception will be thrown.
I agree with noox here. To elaborate on his point:
It isn't B because no governor limits are being exceeded.
It isn't C because we are utilizing Database.update with allOrNone set to false, meaning any updates that potentially fail will not result in an overall failure.
It isn't D because Limit Exceptions cannot be caught.
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.
ApexMike
Highly Voted 2 years, 1 month agoDean5555
2 years, 1 month agonoox
Highly Voted 2 years, 10 months agonoox
2 years, 10 months agoPrince2010
2 years agoSanjeevOnForce
Most Recent 1 year agoirina_735
1 year, 2 months agovancika
1 year, 7 months agoBrucePark
1 year, 3 months agoDonAldos
1 year, 7 months agofreeP
1 year, 8 months agosmoota
1 year, 10 months agovancika
1 year, 7 months agoElAprendiz
2 years agoRajiv1406
2 years, 2 months agoRajiv1406
2 years, 2 months agoAsmodahlia
2 years, 4 months agoliadc
2 years, 6 months agoJCTheGenius
3 years, 2 months agoPally88
3 years, 4 months ago