提交并发请求时使用FUNCTION FND_CONCURRENT.WAIT_FOR_REQUEST等待子并发程序完成

来源:互联网 发布:淘宝如何找相似 编辑:程序博客网 时间:2024/05/22 00:47

在提交并发请求的时候,有些情况需要调用其他的并发程序去处理相应的事务,此时父并发请求进入等待状态,当子程序完成之后接着去处理其他的业务,为了实现这种情况需要使用到FUNCTION FND_CONCURRENT.WAIT_FOR_REQUEST 这个功能。

示例
 log('begin call Import Standard Purchase Orders');    l_request_id := fnd_request.submit_request('PO',                                               'POXPOPDOI',                                               '',                                               to_char(SYSDATE, 'YYYY/MM/DD HH24:MI:SS'),                                               FALSE,                                               NULL,                                               'STANDARD',                                               NULL,                                               'N',                                               NULL,                                               'INCOMPLETE', --'APPROVED',                                               NULL,                                               NULL,                                               lt_org_id,                                               NULL,                                               chr(0));    log(l_request_name || ' Interface Request Submmit.l_request_id=' || l_request_id);    COMMIT;--注意这个commit需要写上,不然会有问题
l_wait_req   := fnd_concurrent.wait_for_request(request_id => p_request_id,                                                    INTERVAL   => 1,                                                    max_wait   => 1000,                                                    phase      => l_child_phase,                                                    status     => l_child_status,                                                    dev_phase  => l_dev_phase,                                                    dev_status => l_dev_status,                                                    message    => l_message);    x_wait_req   := l_wait_req;    x_dev_phase  := l_dev_phase;    x_dev_status := l_dev_status;    x_message    := l_message;

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.

0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 开会时间通知错了怎么办 商场要求商户变更位置怎么办 怀孕初期症状小腹痛怎么办 1岁半宝宝吃夜奶怎么办 戒奶宝宝不喝奶粉怎么办 2岁半宝宝老晚睡怎么办 老是熬夜然后想调生物钟怎么办 一个月宝宝睡眠不好怎么办 个人怎么办一清pos机 社保到退休年龄未交满15年怎么办 退休时社保没交满15时怎么办 单位不支付病假工资怎么办 一年级学生上课注意力不集中怎么办 一年级学生的理解能力差怎么办 一年级学生学习太差怎么办 宝宝屁眼破皮怎么办啊 九个月婴儿不爱喝奶怎么办 十一个月婴儿发烧怎么办 四个月宝宝睡不踏实怎么办 5个月宝宝瘦了怎么办 宝宝只吃迷糊奶怎么办 宝宝五个月了不吃奶粉怎么办 1岁婴儿入睡困难怎么办 怀孕五个月胎儿肾积水怎么办 15个月宝宝总喊怎么办 学业水平考试有d怎么办 买了水果碰见领导怎么办 高一孩子不愿意上学怎么办 专家解答 孩子不愿意上学怎么办 冬天脚冷怎么办膝盖疼 拉拉裤大了怎么办小妙招 孕37周翻身困难怎么办 晚上睡不好白天犯困怎么办 抑郁症又不想起床了怎么办 儿童憋尿功能太差怎么办 一个月的宝宝睡眠不好怎么办 被商场要求撤场怎么办 上班没法接孩子放学怎么办 幼儿下午放学与上班错开怎么办 宝宝早上醒的早怎么办 晚卜睡不着尿多怎么办