Commit every 1000 inserts