Replace deprecated commit_on_success by atomic