Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Difference between running a pl/sql procedure from sql-developer worksheet versus running the same procedure via a Job

Geert01Aug 21 2024

I need a 'keep-alive' procedure that runs frequently to prevent a service from 'spooling down.' The procedure I wrote works perfectly when I execute it directly from SQL Developer using the command EXECUTE keep_alive;.

This procedure calls a rest-api service using:

apex_web_service.oauth_authenticate
( p_token_url => l_token_url
, p_client_id => l_client_id
, p_client_secret => l_client_secret
, p_scope => l_scope
);

However, when I create a scheduler job to run the procedure every 5 minutes, I receive a {"code":502,"message":"Bad Gateway"} response from the API that the keep_alive procedure calls. The procedure does not require any parameters, and the job is created within the same schema as the procedure.

What could be causing this discrepancy in behavior?

Comments
Post Details
Added on Aug 21 2024
12 comments
240 views