function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ken_KoellnerKen_Koellner 

DML Record Limit , to Rolled back updates count?

Anyone know if rolled back updates count toward the DML limit?

 

There limit on DML rows is 10,000.


Support I update 8,000, do a rollback, then update 5,000 more.  Will the blow the limit?

 

 

Afzal MohammadAfzal Mohammad

Per my experience, they don't count.

 

Afzal

AhmedPotAhmedPot

Hi,

 

Well it does counts.Each rollback counts against the total number of DML statements. You will receive a runtime error if you try to rollback
the database additional times.

 

As per Apex developer guide --> Transaction Control section you can refer it for more.

 

Thanks,

Ahmed

Ken_KoellnerKen_Koellner

It says--

  • Each savepoint you set counts against the total number of DML statements
  • Each rollback counts against the total number of DML statements

But it does't say anything about how savepoint and rollback affect the DML row limit.

 

So, if I --


  • savepoint
  • update 8000 rows using 40 DML statements
  • rollback

I've done 42 or 150 available DMLs statements.

 

But, the question is, have I used up 8000 of the 10,000 limit on DML rows?

 

That is the question I am asking.

 

The documentation does not appear to address that question.

 




Goldy Raj 4Goldy Raj 4
hi @ken,

kindly use system.debug(limits.getdmlstatements()) and system.debug(limits.getlimitdmlstatements()) in your code and check the debug log.

kindly post your code so that we can also look into the issue.

thanks