64: select instance_number
65: into l_inst
66: from v$instance;
67:
68: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
69: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
70: 'fnd.plsql.FND_CONC_RAC_UTILS.kill_session',
71: 'Session ID=' ||to_char(p_sid)||', serial#=' ||to_char(p_serial#)||', instance='||to_char(l_inst));
72: end if;
65: into l_inst
66: from v$instance;
67:
68: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
69: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
70: 'fnd.plsql.FND_CONC_RAC_UTILS.kill_session',
71: 'Session ID=' ||to_char(p_sid)||', serial#=' ||to_char(p_serial#)||', instance='||to_char(l_inst));
72: end if;
73:
78:
79: exception
80: when others then
81: if SQLCODE = -30 then
82: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
83: fnd_log.string(FND_LOG.LEVEL_ERROR,
84: 'fnd.plsql.FND_CONC_RAC_UTILS.kill_session',
85: 'Session ID ' ||to_char(p_sid)||', serial# '||to_char(p_serial#)||' not found: '||' in instance '||to_char(l_inst));
86: end if;
79: exception
80: when others then
81: if SQLCODE = -30 then
82: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
83: fnd_log.string(FND_LOG.LEVEL_ERROR,
84: 'fnd.plsql.FND_CONC_RAC_UTILS.kill_session',
85: 'Session ID ' ||to_char(p_sid)||', serial# '||to_char(p_serial#)||' not found: '||' in instance '||to_char(l_inst));
86: end if;
87: raise;
85: 'Session ID ' ||to_char(p_sid)||', serial# '||to_char(p_serial#)||' not found: '||' in instance '||to_char(l_inst));
86: end if;
87: raise;
88: else
89: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
90: fnd_log.string(FND_LOG.LEVEL_ERROR,
91: 'fnd.plsql.FND_CONC_RAC_UTILS.kill_session',
92: 'Unexpected error executing kill for session ID ' ||to_char(p_sid)||', serial# '||to_char(p_serial#)||' in instance '||to_char(l_inst));
93: end if;
86: end if;
87: raise;
88: else
89: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
90: fnd_log.string(FND_LOG.LEVEL_ERROR,
91: 'fnd.plsql.FND_CONC_RAC_UTILS.kill_session',
92: 'Unexpected error executing kill for session ID ' ||to_char(p_sid)||', serial# '||to_char(p_serial#)||' in instance '||to_char(l_inst));
93: end if;
94: raise;
94: raise;
95: end if;
96: end;
97:
98: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
99: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
100: 'fnd.plsql.FND_CONC_RAC_UTILS.kill_session',
101: 'Alter system kill session executed');
102: end if;
95: end if;
96: end;
97:
98: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
99: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
100: 'fnd.plsql.FND_CONC_RAC_UTILS.kill_session',
101: 'Alter system kill session executed');
102: end if;
103:
106: fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
107: fnd_message.set_token('ROUTINE', 'FND_CONC_RAC_UTILS.KILL_SESSION');
108: fnd_message.set_token('ERRNO', SQLCODE);
109: fnd_message.set_token('REASON', SQLERRM);
110: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
111: fnd_log.string(FND_LOG.LEVEL_ERROR,
112: 'fnd.plsql.FND_CONC_RAC_UTILS.kill_session',
113: 'Oracle Error kill_session: '||SQLCODE||': '||SQLERRM);
114: end if;
107: fnd_message.set_token('ROUTINE', 'FND_CONC_RAC_UTILS.KILL_SESSION');
108: fnd_message.set_token('ERRNO', SQLCODE);
109: fnd_message.set_token('REASON', SQLERRM);
110: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
111: fnd_log.string(FND_LOG.LEVEL_ERROR,
112: 'fnd.plsql.FND_CONC_RAC_UTILS.kill_session',
113: 'Oracle Error kill_session: '||SQLCODE||': '||SQLERRM);
114: end if;
115: end;
147:
148: pragma autonomous_transaction;
149:
150: begin
151: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
152: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
153: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
154: 'Session ID ' ||to_char(p_sid)||', serial# ' ||to_char(p_serial#)||', instance '||to_char(p_inst));
155: end if;
148: pragma autonomous_transaction;
149:
150: begin
151: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
152: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
153: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
154: 'Session ID ' ||to_char(p_sid)||', serial# ' ||to_char(p_serial#)||', instance '||to_char(p_inst));
155: end if;
156:
171:
172: exception
173: when others then
174: if SQLCODE = -23428 then
175: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
176: fnd_log.string(FND_LOG.LEVEL_ERROR,
177: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
178: 'Cannot submit dbms_job. Instance '||to_char(p_inst)||' not available.');
179: end if;
172: exception
173: when others then
174: if SQLCODE = -23428 then
175: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
176: fnd_log.string(FND_LOG.LEVEL_ERROR,
177: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
178: 'Cannot submit dbms_job. Instance '||to_char(p_inst)||' not available.');
179: end if;
180: l_retcode := 1;
179: end if;
180: l_retcode := 1;
181: raise;
182: else
183: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
184: if l_inst <> p_inst then
185: fnd_log.string(FND_LOG.LEVEL_ERROR,
186: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
187: 'Unexpected error submitting dbms_job to kill session ' ||to_char(p_sid)||', serial# '||to_char(p_serial#)||' in instance '||to_char(p_inst));
181: raise;
182: else
183: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
184: if l_inst <> p_inst then
185: fnd_log.string(FND_LOG.LEVEL_ERROR,
186: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
187: 'Unexpected error submitting dbms_job to kill session ' ||to_char(p_sid)||', serial# '||to_char(p_serial#)||' in instance '||to_char(p_inst));
188: else
189: fnd_log.string(FND_LOG.LEVEL_ERROR,
185: fnd_log.string(FND_LOG.LEVEL_ERROR,
186: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
187: 'Unexpected error submitting dbms_job to kill session ' ||to_char(p_sid)||', serial# '||to_char(p_serial#)||' in instance '||to_char(p_inst));
188: else
189: fnd_log.string(FND_LOG.LEVEL_ERROR,
190: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
191: 'Unexpected error: '||fnd_message.get||' calling kill_session for session ' ||to_char(p_sid)||', serial# '||to_char(p_serial#)||' in instance '||to_char(p_inst));
192: end if;
193:
198: end;
199:
200: COMMIT;
201:
202: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
203: if l_inst <> p_inst then
204: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
205: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
206: 'Job '||to_char(p_jobno)||' submitted to kill session ID ' ||to_char(p_sid)||', serial# ' ||to_char(p_serial#)||', instance '||to_char(p_inst));
200: COMMIT;
201:
202: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
203: if l_inst <> p_inst then
204: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
205: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
206: 'Job '||to_char(p_jobno)||' submitted to kill session ID ' ||to_char(p_sid)||', serial# ' ||to_char(p_serial#)||', instance '||to_char(p_inst));
207: else
208: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
204: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
205: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
206: 'Job '||to_char(p_jobno)||' submitted to kill session ID ' ||to_char(p_sid)||', serial# ' ||to_char(p_serial#)||', instance '||to_char(p_inst));
207: else
208: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
209: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
210: 'Called kill_session '||'for session ID ' ||to_char(p_sid)||', serial# ' ||to_char(p_serial#)||', in current instance '||to_char(p_inst));
211: end if;
212: end if;
219: fnd_message.set_token('ROUTINE', 'FND_CONC_RAC_UTILS.SUBMIT_KILL_SESSION');
220: fnd_message.set_token('ERRNO', SQLCODE);
221: fnd_message.set_token('REASON', SQLERRM);
222: p_message := fnd_message.get;
223: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
224: fnd_log.string(FND_LOG.LEVEL_ERROR,
225: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
226: 'Exception in submit_kill_session: '||p_message);
227: end if;
220: fnd_message.set_token('ERRNO', SQLCODE);
221: fnd_message.set_token('REASON', SQLERRM);
222: p_message := fnd_message.get;
223: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
224: fnd_log.string(FND_LOG.LEVEL_ERROR,
225: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_kill_session',
226: 'Exception in submit_kill_session: '||p_message);
227: end if;
228: return l_retcode;
256: l_retcode number := 2;
257:
258: begin
259:
260: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
261: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
262: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
263: 'Concurrent process ' ||to_char(p_cpid));
264: end if;
257:
258: begin
259:
260: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
261: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
262: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
263: 'Concurrent process ' ||to_char(p_cpid));
264: end if;
265:
270: where CONCURRENT_PROCESS_ID = p_cpid;
271:
272: exception
273: when no_data_found then
274: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
275: fnd_log.string(FND_LOG.LEVEL_ERROR,
276: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
277: 'Concurrent process ' ||to_char(p_cpid)||' not found');
278: end if;
271:
272: exception
273: when no_data_found then
274: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
275: fnd_log.string(FND_LOG.LEVEL_ERROR,
276: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
277: 'Concurrent process ' ||to_char(p_cpid)||' not found');
278: end if;
279: l_retcode := 1;
278: end if;
279: l_retcode := 1;
280: raise;
281: when others then
282: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
283: fnd_log.string(FND_LOG.LEVEL_ERROR,
284: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
285: 'Unexpected Error querying concurrent process ' ||to_char(p_cpid));
286: end if;
279: l_retcode := 1;
280: raise;
281: when others then
282: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
283: fnd_log.string(FND_LOG.LEVEL_ERROR,
284: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
285: 'Unexpected Error querying concurrent process ' ||to_char(p_cpid));
286: end if;
287: l_retcode := 0;
295: where audsid = l_audsid
296: and inst_id = l_inst;
297: exception
298: when no_data_found then
299: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
300: fnd_log.string(FND_LOG.LEVEL_ERROR,
301: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
302: 'Session (audsid) ' ||to_char(l_audsid)||' in instance '||to_char(l_inst)||' not found for concurrent process '||to_char(p_cpid));
303:
296: and inst_id = l_inst;
297: exception
298: when no_data_found then
299: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
300: fnd_log.string(FND_LOG.LEVEL_ERROR,
301: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
302: 'Session (audsid) ' ||to_char(l_audsid)||' in instance '||to_char(l_inst)||' not found for concurrent process '||to_char(p_cpid));
303:
304: end if;
304: end if;
305: l_retcode := 1;
306: raise;
307: when others then
308: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
309: fnd_log.string(FND_LOG.LEVEL_ERROR,
310: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
311: 'Unexpected Error querying audsid '||to_char(l_audsid)||' in instance '||to_char(l_inst)||'for concurrent process '||to_char(p_cpid));
312: end if;
305: l_retcode := 1;
306: raise;
307: when others then
308: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
309: fnd_log.string(FND_LOG.LEVEL_ERROR,
310: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
311: 'Unexpected Error querying audsid '||to_char(l_audsid)||' in instance '||to_char(l_inst)||'for concurrent process '||to_char(p_cpid));
312: end if;
313: l_retcode := 0;
316:
317: l_retcode := submit_kill_session(p_jobno, p_message, l_sid, l_serial#, l_inst );
318:
319: if (l_retcode <> 2) then
320: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
321: fnd_log.string(FND_LOG.LEVEL_ERROR,
322: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
323: 'Submit_kill_session retcode: '||to_char(l_retcode)||', message: '||p_message);
324: end if;
317: l_retcode := submit_kill_session(p_jobno, p_message, l_sid, l_serial#, l_inst );
318:
319: if (l_retcode <> 2) then
320: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
321: fnd_log.string(FND_LOG.LEVEL_ERROR,
322: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
323: 'Submit_kill_session retcode: '||to_char(l_retcode)||', message: '||p_message);
324: end if;
325: end if;
333: 'FND_CONC_RAC_UTILS.SUBMIT_MANAGER_KILL_SESSION');
334: fnd_message.set_token('ERRNO', SQLCODE);
335: fnd_message.set_token('REASON', SQLERRM);
336: p_message := fnd_message.get;
337: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
338: fnd_log.string(FND_LOG.LEVEL_ERROR,
339: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
340: 'Exception in submit_manager_kill_session: '||p_message);
341: end if;
334: fnd_message.set_token('ERRNO', SQLCODE);
335: fnd_message.set_token('REASON', SQLERRM);
336: p_message := fnd_message.get;
337: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
338: fnd_log.string(FND_LOG.LEVEL_ERROR,
339: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_manager_kill_session',
340: 'Exception in submit_manager_kill_session: '||p_message);
341: end if;
342: return l_retcode;
367: l_cpid number := 2;
368:
369: begin
370:
371: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
372: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
373: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
374: 'Concurrent request ' ||to_char(p_reqid));
375: end if;
368:
369: begin
370:
371: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
372: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
373: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
374: 'Concurrent request ' ||to_char(p_reqid));
375: end if;
376:
381: where request_id = p_reqid;
382:
383: exception
384: when no_data_found then
385: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
386: fnd_log.string(FND_LOG.LEVEL_ERROR,
387: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
388: 'Concurrent request ' ||to_char(p_reqid)||' not found');
389: end if;
382:
383: exception
384: when no_data_found then
385: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
386: fnd_log.string(FND_LOG.LEVEL_ERROR,
387: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
388: 'Concurrent request ' ||to_char(p_reqid)||' not found');
389: end if;
390: l_retcode := 1;
389: end if;
390: l_retcode := 1;
391: raise;
392: when others then
393: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
394: fnd_log.string(FND_LOG.LEVEL_ERROR,
395: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
396: 'Unexpected Error querying concurrent request '
397: ||to_char(p_reqid));
390: l_retcode := 1;
391: raise;
392: when others then
393: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
394: fnd_log.string(FND_LOG.LEVEL_ERROR,
395: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
396: 'Unexpected Error querying concurrent request '
397: ||to_char(p_reqid));
398: end if;
402:
403: l_retcode := submit_manager_kill_session(l_cpid, p_jobno, p_message);
404:
405: if (l_retcode = 2) then
406: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
407: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
408: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
409: 'Job '||to_char(p_jobno)||' to kill manager session of request '||to_char(p_reqid)||' submitted.');
410: end if;
403: l_retcode := submit_manager_kill_session(l_cpid, p_jobno, p_message);
404:
405: if (l_retcode = 2) then
406: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
407: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
408: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
409: 'Job '||to_char(p_jobno)||' to kill manager session of request '||to_char(p_reqid)||' submitted.');
410: end if;
411: else
408: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
409: 'Job '||to_char(p_jobno)||' to kill manager session of request '||to_char(p_reqid)||' submitted.');
410: end if;
411: else
412: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
413: fnd_log.string(FND_LOG.LEVEL_ERROR,
414: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
415: 'Could not submit job to kill manager session of request '||to_char(p_reqid));
416: end if;
409: 'Job '||to_char(p_jobno)||' to kill manager session of request '||to_char(p_reqid)||' submitted.');
410: end if;
411: else
412: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
413: fnd_log.string(FND_LOG.LEVEL_ERROR,
414: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
415: 'Could not submit job to kill manager session of request '||to_char(p_reqid));
416: end if;
417: end if;
424: fnd_message.set_token('ROUTINE',
425: 'FND_CONC_RAC_UTILS.SUBMIT_REQ_MGR_KILL_SESSION');
426: fnd_message.set_token('ERRNO', SQLCODE);
427: fnd_message.set_token('REASON', SQLERRM);
428: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
429: fnd_log.message(FND_LOG.LEVEL_ERROR,
430: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
431: TRUE);
432: end if;
425: 'FND_CONC_RAC_UTILS.SUBMIT_REQ_MGR_KILL_SESSION');
426: fnd_message.set_token('ERRNO', SQLCODE);
427: fnd_message.set_token('REASON', SQLERRM);
428: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
429: fnd_log.message(FND_LOG.LEVEL_ERROR,
430: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_mgr_kill_session',
431: TRUE);
432: end if;
433: return l_retcode;
464: l_retcode number := 2;
465:
466: begin
467:
468: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
469: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
470: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
471: 'Concurrent request ' ||to_char(p_reqid));
472: end if;
465:
466: begin
467:
468: if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
469: fnd_log.string(FND_LOG.LEVEL_STATEMENT,
470: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
471: 'Concurrent request ' ||to_char(p_reqid));
472: end if;
473:
477: from FND_CONCURRENT_REQUESTS
478: where request_id = p_reqid;
479:
480: if l_audsid is null then
481: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
482: fnd_log.string(FND_LOG.LEVEL_ERROR,
483: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
484: 'Cannot find audsid for request ' ||to_char(p_reqid));
485: end if;
478: where request_id = p_reqid;
479:
480: if l_audsid is null then
481: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
482: fnd_log.string(FND_LOG.LEVEL_ERROR,
483: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
484: 'Cannot find audsid for request ' ||to_char(p_reqid));
485: end if;
486: return 1;
487: end if;
488:
489: exception
490: when no_data_found then
491: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
492: fnd_log.string(FND_LOG.LEVEL_ERROR,
493: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
494: 'Concurrent request ' ||to_char(p_reqid)||' not found');
495: end if;
488:
489: exception
490: when no_data_found then
491: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
492: fnd_log.string(FND_LOG.LEVEL_ERROR,
493: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
494: 'Concurrent request ' ||to_char(p_reqid)||' not found');
495: end if;
496: l_retcode := 1;
495: end if;
496: l_retcode := 1;
497: raise;
498: when others then
499: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
500: fnd_log.string(FND_LOG.LEVEL_ERROR,
501: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
502: 'Unexpected Error querying concurrent request ' ||to_char(p_reqid));
503: end if;
496: l_retcode := 1;
497: raise;
498: when others then
499: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
500: fnd_log.string(FND_LOG.LEVEL_ERROR,
501: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
502: 'Unexpected Error querying concurrent request ' ||to_char(p_reqid));
503: end if;
504: l_retcode := 0;
513: where audsid = l_audsid;
514:
515: exception
516: when no_data_found then
517: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
518: fnd_log.string(FND_LOG.LEVEL_ERROR,
519: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
520: 'Session (audsid) ' ||to_char(l_audsid)|| ' not found for concurrent request '||to_char(p_reqid));
521:
514:
515: exception
516: when no_data_found then
517: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
518: fnd_log.string(FND_LOG.LEVEL_ERROR,
519: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
520: 'Session (audsid) ' ||to_char(l_audsid)|| ' not found for concurrent request '||to_char(p_reqid));
521:
522: end if;
523: -- If the session does not exist, our work here is done...
524: return 2;
525:
526: when others then
527: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
528: fnd_log.string(FND_LOG.LEVEL_ERROR,
529: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
530: 'Unexpected Error querying audsid '||to_char(l_audsid)|| 'for concurrent request '||to_char(p_reqid));
531: end if;
524: return 2;
525:
526: when others then
527: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
528: fnd_log.string(FND_LOG.LEVEL_ERROR,
529: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
530: 'Unexpected Error querying audsid '||to_char(l_audsid)|| 'for concurrent request '||to_char(p_reqid));
531: end if;
532: l_retcode := 0;
537:
538: l_retcode := submit_kill_session(p_jobno, p_message, l_sid, l_serial#, l_inst );
539:
540: if (l_retcode <> 2) then
541: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
542: fnd_log.string(FND_LOG.LEVEL_ERROR,
543: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
544: 'Submit_kill_session retcode: '||to_char(l_retcode)||', message: '||p_message);
545: end if;
538: l_retcode := submit_kill_session(p_jobno, p_message, l_sid, l_serial#, l_inst );
539:
540: if (l_retcode <> 2) then
541: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
542: fnd_log.string(FND_LOG.LEVEL_ERROR,
543: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
544: 'Submit_kill_session retcode: '||to_char(l_retcode)||', message: '||p_message);
545: end if;
546: end if;
553: fnd_message.set_token('ROUTINE',
554: 'FND_CONC_RAC_UTILS.SUBMIT_REQ_KILL_SESSION');
555: fnd_message.set_token('ERRNO', SQLCODE);
556: fnd_message.set_token('REASON', SQLERRM);
557: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
558: fnd_log.message(FND_LOG.LEVEL_ERROR,
559: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
560: TRUE);
561: end if;
554: 'FND_CONC_RAC_UTILS.SUBMIT_REQ_KILL_SESSION');
555: fnd_message.set_token('ERRNO', SQLCODE);
556: fnd_message.set_token('REASON', SQLERRM);
557: if( FND_LOG.LEVEL_ERROR >= FND_LOG.G_CURRENT_RUNTIME_LEVEL ) then
558: fnd_log.message(FND_LOG.LEVEL_ERROR,
559: 'fnd.plsql.FND_CONC_RAC_UTILS.submit_req_kill_session',
560: TRUE);
561: end if;
562: return l_retcode;