ORA-29270: too many open HTTP requests

2019-06-16 05:42发布

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;

2条回答
爷、活的狠高调
2楼-- · 2019-06-16 06:11

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); 
查看更多
何必那么认真
3楼-- · 2019-06-16 06:21

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.

查看更多
登录 后发表回答