zoukankan      html  css  js  c++  java
  • FUNCTION FND_CONCURRENT.WAIT_FOR_REQUEST



    Problem Description:
    ====================

    The following describes how to submit concurrent requests using PL/SQL and
    have the parent request 'wait' until each of the child processes have
    completed before it completes.



    Search Words: WAIT_FOR_REQUEST phase status arguments interval



    Solution Description:
    =====================

    When submitting concurrent requests using PL/SQL, it is often desired to have
    the parent process wait until all the child processes have completed before
    completing itself.  The following describes the function used to accomplish
    this.


    Use the FND_CONCURRENT.WAIT_FOR_REQUEST function documented in the Oracle
    Applications Developer’s Guide, RELEASE 11i, Page 21-8  See the FND_CONCURRENT.WAIT_FOR_REQUEST
    function description.

    Summary
            FUNCTION FND_CONCURRENT.WAIT_FOR_REQUEST

      (request_id IN number default NULL,
              interval   IN number default 60,
              max_wait   IN number default 0,
              phase      OUT varchar2,
              status     OUT varchar2,
              dev_phase  OUT varchar2,
              dev_status OUT varchar2,
              message    OUT varchar2) return  boolean;



    Description
    Wait for the request completion, then return the request phase/status and 
    completion message to the caller.  Also call sleep between database checks.


    Arguments (input)


       request_id
            The request ID of the program to wait on.

       interval
            Time to wait between checks.  This is the number of seconds to sleep.  
    The default is 60 seconds.

       max_wait
            The maximum time in seconds to wait for the requests completion.


    Arguments (output)


       phase
            The user friendly request phase from FND_LOOKUPS.

       status
            The user friendly request status from FND_LOOKUPS.

       dev_phase
            The request phase as a constant string that can be used for program 
    logic comparisons.

       dev_status
            The request status as a constant string that can be used for program 
    logic comparisons.

       message
            The completion message supplied if the request has completed.

    语法:

    FUNCTION fnd_concurrent.wait_for_request(request_id IN NUMBER DEFAULT NULL,
                                             INTERVAL   IN NUMBER DEFAULT 60,
                                             max_wait   IN NUMBER DEFAULT 0,
                                             phase      OUT VARCHAR2,
                                             status     OUT VARCHAR2,
                                             dev_phase  OUT VARCHAR2,
                                             dev_status OUT VARCHAR2,
                                             message    OUT VARCHAR2) RETURN BOOLEAN;

    说明:等待并发请求的完成,然后返回请求的阶段、状态以及完成消息。在等待的过程中每隔一段时间检查一下。

    输入参数说明:

    request_id:  并发请求的id

    interval:  两次检查见等待的秒数,两次检查之间该程序会休息

    max_wait: 等待并发请求完成所能等待的的最长时间,单位为秒。

    输出参数同前一个函数,恕罗勇不重复翻译啦。

    原文没有示例用法,罗勇补充个:

    DECLARE
      call_status BOOLEAN;
      rphase      VARCHAR2(80);
      rstatus     VARCHAR2(80);
      dphase      VARCHAR2(30);
      dstatus     VARCHAR2(30);
      message     VARCHAR2(240);
      request_id NUMBER;
    BEGIN
      request_id := 3046222;
      call_status := fnd_concurrent.wait_for_request(request_id,
                                                       10,
                                                       1000,
                                                       rphase,
                                                       rstatus,
                                                       dphase,
                                                       dstatus,
                                                       message);
      IF call_status THEN
        dbms_output.put_line(rphase || '|' || rstatus || '|' || message);
      END IF;
    END;

    程序会等在此处直到并发请求完成或者满了1000秒。

  • 相关阅读:
    sql2slack alash3al 开源的又个轻量级工具
    pgspider fetchq 扩展docker镜像
    godns 集成coredns 的demo
    godns 简单dnsmasq 的dns 替换方案
    aviary.sh 一个基于bash的分布式配置管理工具
    使用coredns 的template plugin实现一个xip 服务
    nginx 代理 coredns dns 服务
    基于nginx proxy dns server
    几个不错的geodns server
    spring boot rest api 最好添加servlet.context-path
  • 原文地址:https://www.cnblogs.com/benio/p/1640518.html
Copyright © 2011-2022 走看看