jcs.waitforone

on-site-related topic PL/SQL API jcs.waitforone

Summary

Wait until any child job is in a finished state and return the job's ID.

Until that time the calling job gets status WAITING (W).

If there are multiple child jobs, jcs.waitforone will return each finished job exactly one time.

A job is in a finished state when its status level is equal or greater than 4; this means CANCELED, UNKNOWN, ERROR, COMPLETED, KILLED or DELETING.

The following exceptions can occur when you wait for a job:

  • JCS-02041 - when the job does not exist yet/anymore.

Specification

Copy
function waitforone()
    return number

Transaction keyword

The transaction keyword defines how and/or when the changes are committed to the database. A definition of the various transaction keywords can be found on the jcs package summary page.

autonomous

Examples

Copy
Using jcs.waitforone
       ...
       jcs.submit(...);
       jcs.submit(...);
       jcs.submit(...);
       commit;
       jcs_out.put_line('First one to finish is ' || jcs.waitforone);

Using jcs.waitforone

See Also