ORA-29270: too many open HTTP requests

邮差的信 提交于 2019-12-08 17:20:54

问题


Can someone help me with this problem that occurs whenever you run a TRIGGER, but works in a normal PROCEDURE?

TRIGGER:

create or replace
procedure testeHTTP(search varchar2)
      IS

Declare
     req   sys.utl_http.req;<BR>
  resp  sys.utl_http.resp;<BR>
 url varchar2(500);

Begin


  url := 'http://www.google.com.br';

  dbms_output.put_line('abrindo');
  -- Abrindo a conexão e iniciando uma requisição
  req := sys.utl_http.begin_request(search);

  dbms_output.put_line('preparando');
  -- Preparandose para obter as respostas
  resp := sys.utl_http.get_response(req);


 dbms_output.put_line('finalizando response');
  -- Encerrando a comunicação request/response
  sys.utl_http.end_response(resp);


Exception
  When Others Then
    dbms_output.put_line('excecao');
    dbms_output.put_line(sys.utl_http.GET_DETAILED_SQLERRM());

End;

回答1:


close your user session and then the problem is fixed.

Internal there is a limit from 5 http requests.

Might a problem is the missing: utl_http.end_response

or an exception in the app and not a close from the resp object.

modify the code like that:

EXCEPTION
  WHEN UTL_HTTP.TOO_MANY_REQUESTS THEN
  UTL_HTTP.END_RESPONSE(resp); 



回答2:


you need to close your requests once you are done with them, it does not happen automatically (unless you disconnect form the db entirely)

It used to be utl_http.end_response, but I am not sure if it is the same api any more.



来源:https://stackoverflow.com/questions/1235679/ora-29270-too-many-open-http-requests

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!