【问题标题】:API Error ORA-29270: too many open HTTP requestsAPI 错误 ORA-29270:打开的 HTTP 请求过多
【发布时间】:2016-12-02 17:11:56
【问题描述】:

我们在尝试执行以下过程时收到 ORA-29270:too many open HTTP requests。请让我们知道我们需要在哪里以及所有需要关闭 Request 和 Response ,请提供我们如何处理异常的过程示例之一。并且所有请求都应该正确处理。

    BEGIN
  l_http_request := utl_http.begin_request (p_url, 'POST');

  BEGIN
    -- build the request by using utl_http.set_header() and utl_http.write_text()
    -- ...

    -- process the request and get the response:
    l_http_response := utl_http.get_response (l_http_request);
   WHEN OTHERS THEN
         --- utl_http.end_response(http_resp);
              error_code := '91'; 
            error_desc := SQLERRM  || ' Unhandled Exception'; 
  END;
  BEGIN
    LOOP
      -- read the response using utl_http.read_line()
      -- ...
    END LOOP;
    -- Complete the request and response, and close the network connection
    utl_http.end_response(l_http_response);

  EXCEPTION 
    when utl_http.end_of_body then
    utl_http.end_response(http_resp); 

    WHEN error_out THEN
        NULL;
   WHEN OTHERS THEN
       --- utl_http.end_response(http_resp);
            error_code := '91'; 
            error_desc := SQLERRM  || ' Unhandled Exception'; 
                      END;
END;

【问题讨论】:

    标签: plsql


    【解决方案1】:

    你好:我碰巧在我自己的代码中解决了同样的错误。我通过添加 utl_http.end_response(l_http_response) 来修复我的 - 你已经拥有了。

    但我注意到您在 end_response 调用中使用了两个不同的参数。尝试改变

    utl_http.end_response(http_resp); 
    

    utl_http.end_response(l_http_response);
    

    在您的异常块中。我希望这有帮助。干杯,鹰

    【讨论】:

      猜你喜欢
      • 2010-11-17
      • 1970-01-01
      • 2018-08-10
      • 1970-01-01
      • 1970-01-01
      • 2011-05-31
      • 2012-12-31
      相关资源
      最近更新 更多