Commit periodically.