Commit transactions all at once to speed up