Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since NoGotnu already answered, I'll put this here: </p> <p>Is there any reason for the procedure to be called through a job? Is it the only way to create the required record? Is the job called anywhere else? Why not call the procedure directly when the required page has been submitted and show the loading icon there? When it finishes, the user knows it has finished. That would involve a lot less fiddling around as you can make apex show a processing graphic on page submit. You could then just inform the user on the other page that the process has not been ran yet and they'd have to do that first.</p> <p>Secondly, while NoGotnu's answer will work, I'd like to point out that in apex 4.2 you should use the <a href="http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/javascript_api.htm#BGBJEFDJ" rel="nofollow noreferrer">apex.server namespace</a> instead of the never documented htmldb_Get construction. <a href="http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/javascript_api.htm#BGBIIJFC" rel="nofollow noreferrer">apex.server.process</a> is a clean implementation of the jQuery ajax setup. NoGotnu's code translated:</p> <pre><code>apex.server.process( "GET_MY_ROW" , null , { dataType: text , success: function(pData){ if (pData == 1) { clearInterval(myInterval); alert('Record loaded successfully'); }; } } ); </code></pre> <p>The call doesn't really need to be async though, but ok.</p> <p>Another option would be to implement a "long poll" instead of firing the ajax event every 5 seconds. A long poll will just initiate a call to the server and wait for a response. As long as the server is busy, the client will wait. To achieve this you could use dbms_alert, as suggested in <a href="https://stackoverflow.com/questions/4599630/waiting-for-a-submitted-job-to-finish-in-oracle-pl-sql">Waiting for a submitted job to finish in Oracle PL/SQL?</a><br> You'd signal an alert in the plsql code of the job, and in the ondemand process code register an interest in the alert and use waitone/any with a 60 second timeout. Presto long poll.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload