Commit batches to send them to the DB