docs: protected void heartbeat() throws SFException, SQLException
    {
      logger.debug(" public void heartbeat()");
  
      if (isClosed)
      {
        return;
      }
  
      HttpPost postRequest = null;
  
      String requestId = UUID.randomUUID().toString();
  
      boolean retry = false;
  
      // the loop for retrying if it runs into session expiration
      do
      {
        try
        {
          URIBuilder uriBuilder;
  
          uriBuilder = new URIBuilder(
              (String) connectionPropertiesMap.get(SFSessionProperty.SERVER_URL));
  
          uriBuilder.addParameter(SFSession.SF_QUERY_REQUEST_ID, requestId);
  
          uriBuilder.setPath(SF_PATH_SESSION_HEARTBEAT);
  
          postRequest = new HttpPost(uriBuilder.build());
  
          // remember the session token in case it expires we need to renew
          // the session only when no other thread has renewed it
          String prevSessionToken = sessionToken;
  
          postRequest.setHeader(SF_HEADER_AUTHORIZATION,
                                SF_HEADER_SNOWFLAKE_AUTHTYPE + " "
                                + SF_HEADER_TOKEN_TAG + "=\""
                                + prevSessionToken + "\"");
  
          logger.debug("Executing heartbeat request: {}",
                       postRequest.toString());
  
          // the following will retry transient network issues
          String theResponse = HttpUtil.executeRequest(postRequest,
                                                       SF_HEARTBEAT_TIMEOUT,
                                                       0,
                                                       null);
  
          JsonNode rootNode;
  
          logger.debug("connection heartbeat response: {}", theResponse);
  
          rootNode = mapper.readTree(theResponse);
  
          // check the response to see if it is session expiration response
          if (rootNode != null &&
              (Constants.SESSION_EXPIRED_GS_CODE == rootNode.path("code").asInt()))
          {
            logger.debug("renew session and retry");
            this.renewSession(prevSessionToken);
            retry = true;
            continue;
          }
  
          SnowflakeUtil.checkErrorAndThrowException(rootNode);
  
          // success
          retry = false;
        }
        catch (Throwable ex)
        {
          // for snowflake exception, just rethrow it
          if (ex instanceof SnowflakeSQLException)
          {
            throw (SnowflakeSQLException) ex;
          }
  
          logger.error("unexpected exception", ex);
  
          throw (SFException) IncidentUtil.generateIncidentV2WithException(
              this,
              new SFException(ErrorCode.INTERNAL_ERROR,
                              IncidentUtil.oneLiner("unexpected exception", ex)),
              null,
              requestId);
        }
      }
      while (retry);
    }