we have a trigger in before insert for Auto number generation and while doing a data loading of 300 records in batch size of 50. The first 50 records get saved but the second 50 gets an error stating duplicate value. It seems the SOQL which fetch the latest auto number didn't consider the 50 processed record . Just wanted to know in case of data loader of multiple batches , is the commit happens to DB after the entire transaction set is over (i.e 300 records) and then commit???
I have seen lot of docs where it says that it comments in batches but I am not sure as I am seeing different results.
Also after doing lot of testing , I find that sometimes the second batch got successful and on the third batch it gives the duplicate value.
On checking the SOQL number of rows returned it seems the query doesn't returned the records which got inserted in the earlier batch.
Is it because of parallel inserting in data loader as I have not selected the serial mode insert.
Any idea?