code: def cancel(self):
          
          self._transaction = False
          try:
              cancel = self._con.cancel
          except AttributeError:
              pass
          else:
              cancel()
docs: Cancel a long-running transaction.
  
          If the underlying driver supports this method, it will be called.