Пример #1
0
 def rollback(self):
     try:
         request = vtgate_pb2.RollbackRequest()
         _add_caller_id(request, self.effective_caller_id)
         self._add_session(request)
         self.stub.Rollback(request, self.timeout)
     except (face.AbortionError, vtgate_utils.VitessError) as e:
         raise _convert_exception(e)
     finally:
         self.session = None
         self.effective_caller_id = None
Пример #2
0
    def rollback_request(self):
        """Builds a vtgate_pb2.RollbackRequest object.

    Uses the effective_caller_id saved from begin_request().
    It will also clear the saved effective_caller_id.

    Returns:
      A vtgate_pb2.RollbackRequest object.
    """
        request = vtgate_pb2.RollbackRequest()
        self._add_caller_id(request, self._effective_caller_id)
        self._add_session(request)
        self._effective_caller_id = None
        return request