利用fnd_conc_global.set_req_globals设置子请求的Parent Request ID

数据库与EBS版本:

RDBMS : 11.1.0.7.0
Oracle Applications : 12.1.2


当在一个concurrent里用fnd_request.submit_request提交一个子请求时,有个叫sub_request的参数,通常我们都设为FALSE,这样子请求可以提起来,

不通过在request的form界面上Parent栏位不会显示父请求的request id。

如果我们直接将sub_request设为TRUE, 子请求就会卡住,报Inactive No Manager

这时我们可以通过一个叫fnd_conc_global的包来解决:


提交请求前设置退出条件:

l_req_data := fnd_conc_global.request_data; IF (l_req_data IS NOT NULL) THEN l_req_data_i := TO_NUMBER (l_req_data); l_req_data_i := l_req_data_i + 1; IF (l_req_data_i > l_tbl_get_language.COUNT) THEN EXIT loop_languages; END IF; ELSE l_req_data_i := 1; END IF;


提交子请求:

l_sub_request_id := fnd_request.submit_request (application => 'XXONT', program => 'XXONT0701', sub_request => TRUE, argument1 => p_order_type_id, argument2 => p_order_num_low, argument3 => p_order_num_high );

提交完子请求后,暂停父请求:

fnd_conc_global.set_req_globals (conc_status => 'PAUSED', request_data => TO_CHAR (l_req_data_i) );

这样提起的子请求是并行运行的。


最终效果如图:




REF:

1. PL/SQL APIs for Concurrent Processing

http://docs.oracle.com/cd/E18727_01/doc.121/e12897/T302934T458258.htm


2. Programming a Concurrent Request Set
http://ltd.kentw.co.uk/technical/concurrent-manager/programming-a-discrete-concurrent-request-set/


3. EBS PL/SQL multithreading example
http://www.orabiz.blogspot.com/2010/06/ebs-plsql-multithreading-example.html


4. Using FND_REQUEST.SUBMIT_REQUEST With Flag SUB_REQUESTS=TRUE Results in Inactive No Manager
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=249105.1



你可能感兴趣的:(利用fnd_conc_global.set_req_globals设置子请求的Parent Request ID)