Skip to Main Content
  • Questions
  • APEX_WEB_SERVICE.MAKE_REQUEST ORA-29270: too many open HTTP requests

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Senthilnathan.

Asked: June 07, 2023 - 7:31 am UTC

Last updated: August 19, 2024 - 2:58 am UTC

Version: 12c

Viewed 1000+ times

You Asked

Hi,

I am using APEX_WEB_SERVICE.MAKE_REQUEST instead of utp_http package to consume rest api calls. Is there are way to close APEX_WEB_SERVICE.MAKE_REQUEST similar to UTL_HTTP.END_RESPONSE?

I am getting ORA-29270: too many open HTTP requests (more than 5), need to call the api due to pagination but the oracle limitation is not allowing.

I was under the impression that APEX_WEB_SERVICE.MAKE_REQUEST does the opening and ending response automatically.

Thank you

and Connor said...

Inside APEX_WEB_SERVICE at the tail of every routine, we pretty much have a

for success:

sys.utl_http.end_response


for failure

exception when others then
    sys.utl_http.end_request(...)
    raise;
end;


so cleanup should be taking place . (I'm looking at APEX 22 and above here).

Can you give me a reproducible test case?

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

A reader, August 14, 2024 - 4:48 pm UTC

so cleanup should be taking place

I'm having the same issue (APEX 23.2). I think there are some places that do not close the connection after an error. E.g. in READ_CLOB_RESPONSE:

       EXCEPTION
            WHEN OTHERS THEN
                IF SQLCODE <> -29266 THEN
                    RAISE;
                END IF;
        END;
        SYS.UTL_HTTP.END_RESPONSE(P_HTTP_RESP);

Connor McDonald
August 19, 2024 - 2:58 am UTC

But where that is *called* has a wrapper

    L_CLOB := READ_CLOB_RESPONSE (
               P_HTTP_RESP => L_HTTP_RESP );

...
EXCEPTION WHEN OTHERS THEN
    SYS.UTL_HTTP.END_REQUEST( L_HTTP_REQ );



More to Explore

APEX

Keep your APEX skills fresh by attending their regular Office Hours sessions.