'Internal method used as get_result_hook for Commit.'

def __commit_hook(self, rpc):

    try:
        rpc.check_success()
    except apiproxy_errors.ApplicationError as err:
        if (err.application_error == datastore_pb.Error.CONCURRENT_TRANSACTION):
            return False
        else:
            raise _ToDatastoreError(err)
    else:
        return True
