Hi,
In Oracle 21.2.6, I have a button that will execute this code,
DECLARE
v_cnt NUMBER;
v_status NUMBER;
BEGIN
INSERT INTO IMPORT_TBL (PROJECT_ID,STATUS,ASSESSMENT_TYPE,IMPORT_TYPE,ASSESSMENT_COMMENT)
VALUES (:P37_PROJECT_ID,'S','Auto','BP','JP submitted') RETURNING ID INTO :P37_JOB_ID;
PRIV_PKG.submit_priv(:P37_JOB_ID
,:P37_PROJECT_ID
,:P37_ENV
,:P37_USER
,:P37_PASS);
COMMIT;
v_cnt := 0;
-- Loop until status becomes letter 'C'
WHILE v_cnt = 0
LOOP
SELECT COUNT(*)
INTO v_status
FROM IMPORT_TBL
WHERE type = 'Auto'
AND status = 'C'
AND id = :P37_JOB_ID;
IF v_status = 1 THEN
INSERT INTO app_tbl (app_name, app_value) VALUES('TEST', 123);
v_cnt := v_cnt + 1;
apex_application.g_print_success_message := 'TEST FORCE EXIT';
EXIT;
END IF;
apex_application.g_print_success_message := 'TEST FORCE EXIT1';
END LOOP;
apex_application.g_print_success_message := 'TEST FORCE EXIT2';
END;
The code above is what gets executed while the loading spinner on the UI side continues to spin until the code finishes.

The issue is, the loading spinner continues to spin forever even after the code has finished being executed as I checked the back-end side or database. I also know that it does not go into forever loop as these lines in the code are what should stop the loop, also proved this on SQL Commands.
v_cnt := v_cnt + 1;
apex_application.g_print_success_message := 'TEST FORCE EXIT';
EXIT;
Is there any way to solve this issue either in the coding side or APEX's page designer side?
Any suggestions is appreciated,
Jazz