code: def rollback_transaction(self):
          
          self._assert_open()
          if not self._transaction:
              raise TransactionError("No transaction to rollback")
          cx = self._connection
          if cx:
              metadata = {}
              try:
                  cx.rollback(on_success=metadata.update)
              finally:
                  self._disconnect(sync=True)
                  self._transaction = None
docs: Rollback the current transaction.
  
          :raise: :class:`.TransactionError` if no transaction is currently open