Does anyone know how does salesforce calculate DML rows? What is included to DML Rows Count?
Consider following code which hits "System.LimitException: Too many DML rows: 10001"
List<MyMisteriousSObject> myList = new List<MyMisteriousSObject>();
for ( Integer i = 0; i < 9996; i++) {
myList.add( new MyMisteriousSObject() );
}
System.debug( 'myList.size() : ' + myList.size() ); // => here I see in debug myList.size() : 9996
insert myList; // => here it fails with "System.LimitException: Too many DML rows: 10001"
How this could be possible?
I believed that DML rows count should be equal to list size, shouldn't it?