+ Start a Discussion
abc def 8abc def 8 

data loader batch size

hi,
data loader default batch size is 200. one batch is considered as one transaction. so while iam updating 200 records 200th record id is not specified. iam getting 199 successes and one error that is as id is not specified. 199 records are being updated. now my question is batch size is 200 then we dont have problem with 199 records, only we have problem with 200th record then total transaction should be failed.  even 199 records should not be processed. process should be rolledback. incase of me why 199 records are being updated. please can any one explain this.
James LoghryJames Loghry
There's nothing "standard" that is wrong here.  The batch will process all records in the scope, whether it's the max you set in your Database.executeBatch call or less depending on how many total records are available.  It's possible the query or scope you're setting in the batch is only 199 records.  Otherwise, it's also possible something is wrong with either the logic in your batch class or a trigger on the object your updates are running against.   I would suggest looking at all these scenarios for any reason why only 199 records would be updated.  Might help to throw a bunch of debug statements throughout your code.  

Also, just so you're aware, the batch size can be set up to 2000.  
abc def 8abc def 8
thank you for your reply, but i am not getting. actually i got doubt about data loader batch size. in batch apex if 200th record is having error all the records are not committed. but in data loader why it is not happening like batch apex. 199 records are committed even 200th record is having problem when dataloader batch size is 200 in data loader. that is what iam not understanding.
Yogesh KulkarniYogesh Kulkarni
There are two ways batches of records are commited
1. All or none commit (This is where all the records would get rolled back if any errored out)
2. Commit all successful (This is where all the successful records will be commited and error would be returned for errored records.

Data loader works with second case.

You can check out this link as well.

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_database.htm#apex_System_Database_insert_2