Use atomic transactions rather manual commit.