您好我有以下过程调用URL并在插入或更新表之前发布JSON数据,它工作得更早。
create or replace FUNCTION post_vacant_list
(p_id IN VARCHAR2)
RETURN clob
IS
XML CLOB;
v_data_post CLOB;
resp utl_http.resp;
req utl_http.req;
v_txt CLOB;
url varchar2(200);
BEGIN
url := '10.54.8.210:9200/temp/20';(http)
xml := JSON_UTIL_PKG.REF_CURSOR_TO_JSON(get_employees(p_id));
req := UTL_HTTP.begin_request (url,'POST','HTTP/1.1');
utl_http.set_header(req, 'Content-Type', 'application/x-www-form-urlencoded');
utl_http.set_header(req, 'Content-Length', length(xml));
v_data_post :=xml;
utl_http.write_text(req, v_data_post);
resp := UTL_HTTP.get_response(req);
utl_http.read_text(resp,v_txt);
utl_http.end_response(resp);
UTL_HTTP.end_request (req);
dbms_output.put_line('v_txt'|| v_txt);
exception
WHEN UTL_HTTP.TOO_MANY_REQUESTS THEN
UTL_HTTP.END_RESPONSE(resp);
when others then
UTL_TCP.Close_All_Connections;
RETURN sqlerrm;
end;
但是,现在我在尝试检查不同的数据集时遇到以下错误(即,如上所述从包中调用它)
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-29270: too many open HTTP requests
您可以帮我解决上述问题吗?如何结束http连接?
我尝试将End_response
和End_request
添加到我的程序中,但看起来这个问题仍然存在。