ORA-29270: Too Many Open HTTP Requests

Can someone help me with this problem that occurs whenever you run 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;
+8
source share
2 answers

Close the user session and fix the problem.

The internal limit is 5 HTTP requests.

Perhaps the problem is the lack of: utl_http.end_response

or an exception in the application, not closure from the resp object.

change the code as follows:

EXCEPTION
  WHEN UTL_HTTP.TOO_MANY_REQUESTS THEN
  UTL_HTTP.END_RESPONSE(resp); 
+13
source

you need to close your requests as soon as you are done with them, this will not happen automatically (unless you completely disconnect the db form)

utl_http.end_response, , api.

+3

All Articles