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
vijaymindvijaymind 

To Many DML Row 10001 in Batch Apex

HI All,

 

Why I am getting this error even I am processing all my record in a batch of 200 size. Salesforce didnot documented batch class concept very much clear anywhere.That how batch are runs how batch thread works ? Are all thread of a single batch runs parallely ? Nothing 

 

 

Thanks

Vijay

ibtesamibtesam

Hi Vijay,

 

Batch class resets the apex limits for each transaction. but still the limit holds in a particular transaction run.

check if you have too many rows to save in each run.

 

Below Link may help find a workaround

http://boards.developerforce.com/t5/Apex-Code-Development/How-to-solve-Too-many-DML-rows-10001-error-while-inserting-the/td-p/409363

 

vijaymindvijaymind

Thank for reply.

Well I am sure I have fully optimized code and I have never over 10001 records in list because of 200 size so what I am thinking error not because of execute method. Error may cause the finish method because I am doing some dml in that also.

I need to workout to reach out the exact reason.

admintrmpadmintrmp
Check your triggers as well.