DBA Data[Home] [Help]

APPS.FND_OAM_DSCRAM_UNITS_PKG dependencies on FND_OAM_DEBUG

Line 140: fnd_oam_debug.log(2, l_ctxt, 'ENTER');

136: l_phase NUMBER;
137: l_workers_allowed NUMBER(15);
138: l_workers_assigned NUMBER(15);
139: BEGIN
140: fnd_oam_debug.log(2, l_ctxt, 'ENTER');
141: x_return_status := FND_API.G_RET_STS_ERROR;
142: x_return_msg := '';
143:
144: --handle closing/opening the cursor as necessary depending on p_requery

Line 163: fnd_oam_debug.log(1, l_ctxt, 'B_UNITS empty');

159: FETCH B_UNITS INTO l_unit_id, l_status, l_phase, l_workers_allowed, l_workers_assigned;
160:
161: -- no rows is an empty
162: IF B_UNITS%NOTFOUND THEN
163: fnd_oam_debug.log(1, l_ctxt, 'B_UNITS empty');
164: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
165: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_EMPTY;
166: CLOSE B_UNITS;
167: RETURN;

Line 164: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

160:
161: -- no rows is an empty
162: IF B_UNITS%NOTFOUND THEN
163: fnd_oam_debug.log(1, l_ctxt, 'B_UNITS empty');
164: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
165: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_EMPTY;
166: CLOSE B_UNITS;
167: RETURN;
168: END IF;

Line 172: fnd_oam_debug.log(1, l_ctxt, 'Unit ID(Status): '||l_unit_id||'('||l_status||')');

168: END IF;
169:
170: -- begin a loop here to do additional fetches if we detect there isn't a spot for a worker
171: LOOP
172: fnd_oam_debug.log(1, l_ctxt, 'Unit ID(Status): '||l_unit_id||'('||l_status||')');
173:
174: -- if the last_phase isn't null, make sure we're not looking at a unit in a later
175: -- phase, makes the assumption that there is no phase after null.
176: IF b_last_fetched_unit_phase IS NOT NULL AND

Line 181: fnd_oam_debug.log(1, l_ctxt, 'Unit Phase('||l_phase||') later than last_phase('||b_last_fetched_unit_phase||')');

177: (l_phase IS NULL OR b_last_fetched_unit_phase < l_phase) THEN
178: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_FULL;
179: -- close the cursor to allow the current, invalid unit to get queried up next time
180: CLOSE B_UNITS;
181: fnd_oam_debug.log(1, l_ctxt, 'Unit Phase('||l_phase||') later than last_phase('||b_last_fetched_unit_phase||')');
182: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
183: RETURN;
184: END IF;
185:

Line 182: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

178: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_FULL;
179: -- close the cursor to allow the current, invalid unit to get queried up next time
180: CLOSE B_UNITS;
181: fnd_oam_debug.log(1, l_ctxt, 'Unit Phase('||l_phase||') later than last_phase('||b_last_fetched_unit_phase||')');
182: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
183: RETURN;
184: END IF;
185:
186: --if the unit's finishing, we're just here to log its phase and fetch the next - we can't return this unit

Line 188: fnd_oam_debug.log(1, l_ctxt, 'Found finishing unit, Fetching Next');

184: END IF;
185:
186: --if the unit's finishing, we're just here to log its phase and fetch the next - we can't return this unit
187: IF l_status = FND_OAM_DSCRAM_UTILS_PKG.G_STATUS_FINISHING THEN
188: fnd_oam_debug.log(1, l_ctxt, 'Found finishing unit, Fetching Next');
189: ELSE
190: -- see if there's space in the unit
191: IF l_workers_allowed IS NULL OR l_workers_assigned < l_workers_allowed THEN
192: --exit to return the unit

Line 195: fnd_oam_debug.log(1, l_ctxt, 'Unit Full, Fetching Next');

191: IF l_workers_allowed IS NULL OR l_workers_assigned < l_workers_allowed THEN
192: --exit to return the unit
193: EXIT;
194: ELSE
195: fnd_oam_debug.log(1, l_ctxt, 'Unit Full, Fetching Next');
196: END IF;
197: END IF;
198:
199: -- if we're still in the loop at this point, set this unit to the last fetched and fetch

Line 211: fnd_oam_debug.log(1, l_ctxt, 'No more units to Fetch');

207: -- no rows at this point isn't an empty but a full
208: IF B_UNITS%NOTFOUND THEN
209: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_FULL;
210: CLOSE B_UNITS;
211: fnd_oam_debug.log(1, l_ctxt, 'No more units to Fetch');
212: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
213: RETURN;
214: END IF;
215: END LOOP;

Line 212: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

208: IF B_UNITS%NOTFOUND THEN
209: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_FULL;
210: CLOSE B_UNITS;
211: fnd_oam_debug.log(1, l_ctxt, 'No more units to Fetch');
212: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
213: RETURN;
214: END IF;
215: END LOOP;
216:

Line 223: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

219: b_last_fetched_unit_id := l_unit_id;
220: b_last_fetched_unit_phase := l_phase;
221:
222: --success
223: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
224: x_return_status := FND_API.G_RET_STS_SUCCESS;
225: EXCEPTION
226: WHEN OTHERS THEN
227: IF B_UNITS%ISOPEN THEN

Line 231: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

227: IF B_UNITS%ISOPEN THEN
228: CLOSE B_UNITS;
229: END IF;
230: x_return_msg := 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))';
231: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
232: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
233: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
234: END;
235:

Line 233: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

229: END IF;
230: x_return_msg := 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))';
231: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
232: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
233: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
234: END;
235:
236: -- Private
237: -- Called by execute_unit as a sanity check on the unit_id before beginning execution.

Line 256: fnd_oam_debug.log(2, l_ctxt, 'ENTER');

252: SELECT unit_status
253: FROM fnd_oam_dscram_units
254: WHERE unit_id = p_unit_id;
255: BEGIN
256: fnd_oam_debug.log(2, l_ctxt, 'ENTER');
257: x_return_status := FND_API.G_RET_STS_ERROR;
258: x_return_msg := '';
259:
260: -- automatically valid if unit_id same as last fetched

Line 263: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

259:
260: -- automatically valid if unit_id same as last fetched
261: IF p_unit_id = b_last_fetched_unit_id THEN
262: x_return_status := FND_API.G_RET_STS_SUCCESS;
263: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
264: RETURN TRUE;
265: END IF;
266:
267: --fetch necessary unit attributes

Line 272: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

268: OPEN C1;
269: FETCH C1 INTO l_status;
270: IF C1%NOTFOUND THEN
271: x_return_msg := 'Invalid unit_id: ('||p_unit_id||')';
272: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
273: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
274: RETURN FALSE;
275: END IF;
276: CLOSE C1;

Line 273: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

269: FETCH C1 INTO l_status;
270: IF C1%NOTFOUND THEN
271: x_return_msg := 'Invalid unit_id: ('||p_unit_id||')';
272: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
273: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
274: RETURN FALSE;
275: END IF;
276: CLOSE C1;
277:

Line 284: fnd_oam_debug.log(1, l_ctxt, x_return_msg);

280: -- report the true status of the unit to execute to pass on to execute's caller
281: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.CONV_VALIDATE_START_STS_TO_RET(l_status);
282: IF FND_OAM_DSCRAM_UTILS_PKG.RET_STS_IS_ERROR(x_return_status) THEN
283: x_return_msg := 'Invalid task status('||l_status||')';
284: fnd_oam_debug.log(1, l_ctxt, x_return_msg);
285: END IF;
286: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
287: RETURN FALSE;
288: END IF;

Line 286: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

282: IF FND_OAM_DSCRAM_UTILS_PKG.RET_STS_IS_ERROR(x_return_status) THEN
283: x_return_msg := 'Invalid task status('||l_status||')';
284: fnd_oam_debug.log(1, l_ctxt, x_return_msg);
285: END IF;
286: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
287: RETURN FALSE;
288: END IF;
289:
290: --success

Line 291: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

287: RETURN FALSE;
288: END IF;
289:
290: --success
291: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
292: x_return_status := FND_API.G_RET_STS_SUCCESS;
293: RETURN TRUE;
294: EXCEPTION
295: WHEN OTHERS THEN

Line 297: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

293: RETURN TRUE;
294: EXCEPTION
295: WHEN OTHERS THEN
296: x_return_msg := 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))';
297: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
298: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
299: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
300: RETURN FALSE;
301: END;

Line 299: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

295: WHEN OTHERS THEN
296: x_return_msg := 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))';
297: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
298: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
299: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
300: RETURN FALSE;
301: END;
302:
303: -- Public

Line 337: fnd_oam_debug.log(1, l_ctxt, '>RE-QUERYING<');

333: -- check if we should do work or if we can presume the cached status
334: IF (p_force_query OR
335: FND_OAM_DSCRAM_UTILS_PKG.VALIDATION_DUE(b_unit_info.last_validated)) THEN
336:
337: fnd_oam_debug.log(1, l_ctxt, '>RE-QUERYING<');
338:
339: -- re-init the cached fields to allow easy exit
340: b_unit_info.last_validation_ret_sts := x_return_status;
341: b_unit_info.last_validated := SYSDATE;

Line 349: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

345: FETCH C1 INTO l_status;
346: IF C1%NOTFOUND THEN
347: --shouldn't happen since we're using the cache
348: x_return_msg := 'Invalid cached unit_id: '||b_unit_info.unit_id;
349: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
350: RETURN FALSE;
351: END IF;
352: CLOSE C1;
353:

Line 360: fnd_oam_debug.log(1, l_ctxt, x_return_msg);

356: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.CONV_VALIDATE_CONT_STS_TO_RET(l_status);
357: b_unit_info.last_validation_ret_sts := x_return_status;
358: IF x_return_status <> FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_PROCESSED THEN
359: x_return_msg := 'Invalid unit status('||l_status||')';
360: fnd_oam_debug.log(1, l_ctxt, x_return_msg);
361: END IF;
362: RETURN FALSE;
363: END IF;
364: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 378: fnd_oam_debug.log(1, l_ctxt, x_return_msg);

374: l_return_msg) THEN
375: -- the run has an invalid status, tell the execute to stop the unit
376: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_STOPPED;
377: x_return_msg := '[Continued Validation of Parent(s) Failed]:(Status('||l_return_status||'), Msg('||l_return_msg||'))';
378: fnd_oam_debug.log(1, l_ctxt, x_return_msg);
379: RETURN FALSE;
380: END IF;
381: END IF;
382:

Line 390: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

386: RETURN (x_return_status = FND_API.G_RET_STS_SUCCESS);
387: EXCEPTION
388: WHEN OTHERS THEN
389: x_return_msg := 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))';
390: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
391: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
392: b_unit_info.last_validation_ret_sts := x_return_status;
393: b_unit_info.last_validated := SYSDATE;
394: RETURN FALSE;

Line 428: fnd_oam_debug.log(2, l_ctxt, 'ENTER');

424: l_use_splitting BOOLEAN;
425:
426: l_status VARCHAR2(30) := NULL;
427: BEGIN
428: fnd_oam_debug.log(2, l_ctxt, 'ENTER');
429: x_return_status := FND_API.G_RET_STS_ERROR;
430: x_return_msg := '';
431:
432: -- Do a locking select without a pre-select since we always have to update the unit

Line 443: fnd_oam_debug.log(1, l_ctxt, 'Unit Status: '||l_status);

439: FROM fnd_oam_dscram_units
440: WHERE unit_id = p_unit_id
441: FOR UPDATE;
442:
443: fnd_oam_debug.log(1, l_ctxt, 'Unit Status: '||l_status);
444: fnd_oam_debug.log(1, l_ctxt, 'Workers Allow(Sug/Act), Assigned: ('||l_suggest_workers_allowed||')('||l_actual_workers_allowed||'), '||l_workers_assigned||')');
445:
446: -- make sure the status is runnable after the lock
447: IF NOT FND_OAM_DSCRAM_UTILS_PKG.STATUS_IS_EXECUTABLE(l_status) THEN

Line 444: fnd_oam_debug.log(1, l_ctxt, 'Workers Allow(Sug/Act), Assigned: ('||l_suggest_workers_allowed||')('||l_actual_workers_allowed||'), '||l_workers_assigned||')');

440: WHERE unit_id = p_unit_id
441: FOR UPDATE;
442:
443: fnd_oam_debug.log(1, l_ctxt, 'Unit Status: '||l_status);
444: fnd_oam_debug.log(1, l_ctxt, 'Workers Allow(Sug/Act), Assigned: ('||l_suggest_workers_allowed||')('||l_actual_workers_allowed||'), '||l_workers_assigned||')');
445:
446: -- make sure the status is runnable after the lock
447: IF NOT FND_OAM_DSCRAM_UTILS_PKG.STATUS_IS_EXECUTABLE(l_status) THEN
448: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.CONV_VALIDATE_START_STS_TO_RET(l_status);

Line 451: fnd_oam_debug.log(1, l_ctxt, x_return_msg);

447: IF NOT FND_OAM_DSCRAM_UTILS_PKG.STATUS_IS_EXECUTABLE(l_status) THEN
448: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.CONV_VALIDATE_START_STS_TO_RET(l_status);
449: IF FND_OAM_DSCRAM_UTILS_PKG.RET_STS_IS_ERROR(x_return_status) THEN
450: x_return_msg := 'Invalid unit in assign, status('||l_status||')';
451: fnd_oam_debug.log(1, l_ctxt, x_return_msg);
452: END IF;
453: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
454: ROLLBACK;
455: RETURN;

Line 453: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

449: IF FND_OAM_DSCRAM_UTILS_PKG.RET_STS_IS_ERROR(x_return_status) THEN
450: x_return_msg := 'Invalid unit in assign, status('||l_status||')';
451: fnd_oam_debug.log(1, l_ctxt, x_return_msg);
452: END IF;
453: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
454: ROLLBACK;
455: RETURN;
456: END IF;
457:

Line 464: fnd_oam_debug.log(1, l_ctxt, 'No workers slot available, returning full.');

460: l_workers_assigned >= l_actual_workers_allowed) OR
461: (l_actual_workers_allowed IS NULL AND
462: l_workers_assigned >= l_suggest_workers_allowed)) THEN
463: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_FULL;
464: fnd_oam_debug.log(1, l_ctxt, 'No workers slot available, returning full.');
465: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
466: ROLLBACK;
467: RETURN;
468: END IF;

Line 465: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

461: (l_actual_workers_allowed IS NULL AND
462: l_workers_assigned >= l_suggest_workers_allowed)) THEN
463: x_return_status := FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_FULL;
464: fnd_oam_debug.log(1, l_ctxt, 'No workers slot available, returning full.');
465: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
466: ROLLBACK;
467: RETURN;
468: END IF;
469:

Line 488: fnd_oam_debug.log(1, l_ctxt, 'Small unit or forced disable splitting, using Serial Execution.');

484: --all execute at once on a chunk of rows.
485: IF ((l_weight IS NOT NULL AND
486: l_weight < FND_OAM_DSCRAM_BUNDLES_PKG.GET_MIN_PARALLEL_UNIT_WEIGHT) OR
487: (l_suggest_disable_splitting = FND_API.G_TRUE)) THEN
488: fnd_oam_debug.log(1, l_ctxt, 'Small unit or forced disable splitting, using Serial Execution.');
489:
490: -- don't overwrite the actual values if they've been set by a previous start, don't want to change state after
491: -- we've already set it..
492: l_actual_workers_allowed := NVL(l_actual_workers_allowed, 1);

Line 510: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

506: WHERE unit_id = p_unit_id;
507: ELSE
508: --the unit isn't processing but somebody's set it to processing, this shouldn't happen
509: x_return_msg := 'Unit Status ('||l_status||') is not in-progress but the number of workers assigned('||l_workers_assigned||') is nonzero.';
510: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
511: ROLLBACK;
512: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
513: RETURN;
514: END IF;

Line 512: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

508: --the unit isn't processing but somebody's set it to processing, this shouldn't happen
509: x_return_msg := 'Unit Status ('||l_status||') is not in-progress but the number of workers assigned('||l_workers_assigned||') is nonzero.';
510: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
511: ROLLBACK;
512: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
513: RETURN;
514: END IF;
515: END IF;
516:

Line 549: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

545: b_last_fetched_unit_id := NULL;
546: b_last_fetched_unit_phase := NULL;
547:
548: x_return_status := FND_API.G_RET_STS_SUCCESS;
549: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
550: EXCEPTION
551: WHEN OTHERS THEN
552: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
553: x_return_msg := 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))';

Line 554: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

550: EXCEPTION
551: WHEN OTHERS THEN
552: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
553: x_return_msg := 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))';
554: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
555: ROLLBACK;
556: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
557: END;
558:

Line 556: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

552: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
553: x_return_msg := 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))';
554: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
555: ROLLBACK;
556: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
557: END;
558:
559: -- Private
560: -- Called when a unit is completed in some way. Duties include updating the

Line 596: fnd_oam_debug.log(2, l_ctxt, 'ENTER');

592: k NUMBER;
593: l_return_status VARCHAR2(6);
594: l_return_msg VARCHAR2(2048);
595: BEGIN
596: fnd_oam_debug.log(2, l_ctxt, 'ENTER');
597:
598: -- always lock the unit since we have to decrement the worker count
599: SELECT unit_status, workers_assigned
600: INTO l_status, l_workers_assigned

Line 633: fnd_oam_debug.log(6, l_ctxt, l_return_msg);

629:
630: ELSE
631: --attach the error message to the unit, completing the work items with an unknown type won't get far
632: l_message := 'Work Item ID ('||px_work_queue_to_complete(k).item_id||'), invalid work item type: '||px_work_queue_to_complete(k).item_type;
633: fnd_oam_debug.log(6, l_ctxt, l_return_msg);
634: RAISE COMPLETE_FAILED;
635: END CASE;
636:
637: --if the called update method failed, exit early

Line 681: fnd_oam_debug.log(6, l_ctxt, l_message);

677: l_return_msg);
678: END IF;
679: ELSE
680: l_message := 'Work Item ID ('||px_work_queue_to_complete(k).item_id||'), invalid work item type: '||px_work_queue_to_complete(k).item_type;
681: fnd_oam_debug.log(6, l_ctxt, l_message);
682: RAISE COMPLETE_FAILED;
683: END CASE;
684:
685: --check if the complete_ succeeded, stop processing if it did

Line 695: fnd_oam_debug.log(1, l_ctxt, 'Proposed Unit(s) Ret Sts: '||l_proposed_ret_sts);

691: END LOOP;
692:
693: --only manually destroy the cache entities when the work item was successful, otherwise
694: --let the catch-all destroy_cache methods get it
695: fnd_oam_debug.log(1, l_ctxt, 'Proposed Unit(s) Ret Sts: '||l_proposed_ret_sts);
696: IF l_proposed_ret_sts = FND_API.G_RET_STS_SUCCESS THEN
697: --we don't need to clone the context here before execution because the run requires an explicit
698: --set_context to update the real context object.
699: k := px_work_queue_to_complete.FIRST;

Line 777: fnd_oam_debug.log(1, l_ctxt, 'Translated status "'||l_proposed_status||'" into "'||l_final_status||'"');

773: l_proposed_status,
774: l_proposed_ret_sts,
775: l_final_status,
776: l_final_ret_sts);
777: fnd_oam_debug.log(1, l_ctxt, 'Translated status "'||l_proposed_status||'" into "'||l_final_status||'"');
778: fnd_oam_debug.log(1, l_ctxt, 'Translated Execute Ret Sts "'||l_proposed_ret_sts||'" into "'||l_final_ret_sts||'"');
779:
780: --if we discovered that we're full, possibly temporarily, just decrement the worker count and leave if we're not the last worker
781: IF l_final_ret_sts = FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_FULL AND l_workers_assigned > 1 THEN

Line 778: fnd_oam_debug.log(1, l_ctxt, 'Translated Execute Ret Sts "'||l_proposed_ret_sts||'" into "'||l_final_ret_sts||'"');

774: l_proposed_ret_sts,
775: l_final_status,
776: l_final_ret_sts);
777: fnd_oam_debug.log(1, l_ctxt, 'Translated status "'||l_proposed_status||'" into "'||l_final_status||'"');
778: fnd_oam_debug.log(1, l_ctxt, 'Translated Execute Ret Sts "'||l_proposed_ret_sts||'" into "'||l_final_ret_sts||'"');
779:
780: --if we discovered that we're full, possibly temporarily, just decrement the worker count and leave if we're not the last worker
781: IF l_final_ret_sts = FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_FULL AND l_workers_assigned > 1 THEN
782: UPDATE fnd_oam_dscram_units

Line 827: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

823: CLOSE B_UNITS;
824: END IF;
825: END IF;
826:
827: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
828: EXCEPTION
829: WHEN OTHERS THEN
830: x_final_ret_sts := FND_API.G_RET_STS_UNEXP_ERROR;
831: fnd_oam_debug.log(6, l_ctxt, 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))');

Line 831: fnd_oam_debug.log(6, l_ctxt, 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))');

827: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
828: EXCEPTION
829: WHEN OTHERS THEN
830: x_final_ret_sts := FND_API.G_RET_STS_UNEXP_ERROR;
831: fnd_oam_debug.log(6, l_ctxt, 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))');
832: --safety rollback
833: ROLLBACK;
834: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
835: END;

Line 834: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

830: x_final_ret_sts := FND_API.G_RET_STS_UNEXP_ERROR;
831: fnd_oam_debug.log(6, l_ctxt, 'Unhandled Exception: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))');
832: --safety rollback
833: ROLLBACK;
834: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
835: END;
836:
837: -- Private wrapper for aborted unit executions
838: PROCEDURE COMPLETE_UNIT_IN_ERROR(p_unit_id IN NUMBER,

Line 875: fnd_oam_debug.log(1, l_ctxt, 'Using owner.table: '||p_object_owner||'.'||p_object_name);

871: BEGIN
872: x_return_status := FND_API.G_RET_STS_ERROR;
873: x_return_msg := '';
874:
875: fnd_oam_debug.log(1, l_ctxt, 'Using owner.table: '||p_object_owner||'.'||p_object_name);
876:
877: --Default the # of workers and batch size from the bundle if they're not defined for the unit.
878: --Values in the bundle are non-null and these fields are required for AD to function in the multi-worker case.
879: AD_PARALLEL_UPDATES_PKG.INITIALIZE_ROWID_RANGE(X_update_type => AD_PARALLEL_UPDATES_PKG.ROWID_RANGE,

Line 891: fnd_oam_debug.log(1, l_ctxt, 'Finished initialize.');

887: X_processed_mode => AD_PARALLEL_UPDATES_PKG.PRESERVE_PROCESSED_UNITS);
888: --safety commit
889: COMMIT;
890:
891: fnd_oam_debug.log(1, l_ctxt, 'Finished initialize.');
892:
893: -- no return code indicating whether it succeeded, exceptions are thrown
894: x_return_status := FND_API.G_RET_STS_SUCCESS;
895: EXCEPTION

Line 898: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

894: x_return_status := FND_API.G_RET_STS_SUCCESS;
895: EXCEPTION
896: WHEN OTHERS THEN
897: x_return_msg := 'Unit ID ('||p_unit_id||'), Failed to initialize the AD table splitting infrastructure: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))';
898: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
899: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
900: ROLLBACK;
901: END;
902:

Line 918: fnd_oam_debug.log(1, l_ctxt, 'Getting next range...');

914: BEGIN
915: x_return_status := FND_API.G_RET_STS_ERROR;
916: x_return_msg := '';
917:
918: fnd_oam_debug.log(1, l_ctxt, 'Getting next range...');
919:
920: AD_PARALLEL_UPDATES_PKG.GET_ROWID_RANGE(X_start_rowid => x_rowid_lbound,
921: X_end_rowid => x_rowid_ubound,
922: X_any_rows => x_rows_found,

Line 928: fnd_oam_debug.log(1, l_ctxt, 'Done.');

924: X_restart => FALSE); --also unused in 120.2
925: --safety commit
926: COMMIT;
927:
928: fnd_oam_debug.log(1, l_ctxt, 'Done.');
929:
930: --make sure rows found has a value
931: IF x_rows_found IS NULL THEN
932: x_rows_found := FALSE;

Line 940: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

936: x_return_status := FND_API.G_RET_STS_SUCCESS;
937: EXCEPTION
938: WHEN OTHERS THEN
939: x_return_msg := 'Failed to fetch next AD range: (Code('||SQLCODE||'), Message("'||SQLERRM||'"))';
940: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
941: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
942: ROLLBACK;
943: END;
944:

Line 997: --fnd_oam_debug.log(2, l_ctxt, 'ENTER');

993: k NUMBER;
994: l_return_status VARCHAR2(6);
995: l_return_msg VARCHAR2(2048);
996: BEGIN
997: --fnd_oam_debug.log(2, l_ctxt, 'ENTER');
998: x_return_msg := '';
999:
1000: --if we've got no work, just return
1001: IF px_work_queue IS NULL OR px_work_queue.COUNT = 0 THEN

Line 1003: fnd_oam_debug.log(1, l_ctxt, 'Work queue empty, returning success.');

999:
1000: --if we've got no work, just return
1001: IF px_work_queue IS NULL OR px_work_queue.COUNT = 0 THEN
1002: x_return_status := FND_API.G_RET_STS_SUCCESS;
1003: fnd_oam_debug.log(1, l_ctxt, 'Work queue empty, returning success.');
1004: RETURN;
1005: END IF;
1006:
1007: --work to do, default the status

Line 1026: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

1022: l_return_msg);
1023: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1024: x_return_status := l_return_status;
1025: x_return_msg := '[Error initializing AD Split]: '||l_return_msg;
1026: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1027: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1028: RETURN;
1029: END IF;
1030:

Line 1027: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1023: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1024: x_return_status := l_return_status;
1025: x_return_msg := '[Error initializing AD Split]: '||l_return_msg;
1026: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1027: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1028: RETURN;
1029: END IF;
1030:
1031: --before beginning the loop, force a check of the unit since the only way a worker could get

Line 1041: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1037: l_return_status,
1038: l_return_msg) THEN
1039: x_return_status := l_return_status;
1040: x_return_msg := l_return_msg;
1041: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1042: RETURN;
1043: END IF;
1044:
1045: --loop over ranges of rows

Line 1056: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1052: l_return_msg);
1053: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1054: x_return_status := l_return_status;
1055: x_return_msg := l_return_msg;
1056: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1057: RETURN;
1058: END IF;
1059:
1060: --if no work, exit the loop

Line 1093: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

1089:
1090: ELSE
1091: x_return_msg := 'Work Item ID('||px_work_queue(k).item_id||'), invalid work item type:'||px_work_queue(k).item_type;
1092: --skip setting the work item's message since this can only be logged at the unit level
1093: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1094: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1095: RETURN;
1096: END CASE;
1097:

Line 1094: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1090: ELSE
1091: x_return_msg := 'Work Item ID('||px_work_queue(k).item_id||'), invalid work item type:'||px_work_queue(k).item_type;
1092: --skip setting the work item's message since this can only be logged at the unit level
1093: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1094: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1095: RETURN;
1096: END CASE;
1097:
1098: --check if our work suceeded, if not we quick fail because AD can't

Line 1112: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1108: -- Although sometimes this message will also be logged with the DML, we pass up the message to get logged
1109: -- with the unit also in case the error occurred before the entity could get into the entity's cache and
1110: -- store such an error message locally.
1111: x_return_msg := 'Work Item with type('||px_work_queue(k).item_type||'),id('||px_work_queue(k).item_id||') failed: '||l_return_msg;
1112: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1113: RETURN;
1114: END IF;
1115:
1116: --work item suceeded, see if the number of rows processed was greater than our currently seen max

Line 1132: fnd_oam_debug.log(1, l_ctxt, 'Rolling back changes because of non-standard run mode');

1128: l_max_range_rows_processed);
1129: COMMIT;
1130: ELSE
1131: ROLLBACK;
1132: fnd_oam_debug.log(1, l_ctxt, 'Rolling back changes because of non-standard run mode');
1133: --autonomously complete the range to keep AD progressing
1134: COMPLETE_AD_RANGE_AUTONOMOUSLY(l_rowid_ubound,
1135: l_max_range_rows_processed);
1136: END IF;

Line 1146: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1142: l_return_status,
1143: l_return_msg) THEN
1144: x_return_status := l_return_status;
1145: x_return_msg := l_return_msg;
1146: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1147: RETURN;
1148: END IF;
1149:
1150: END LOOP;

Line 1151: fnd_oam_debug.log(1, l_ctxt, 'Done splitting, ad range selection loop exhausted.');

1147: RETURN;
1148: END IF;
1149:
1150: END LOOP;
1151: fnd_oam_debug.log(1, l_ctxt, 'Done splitting, ad range selection loop exhausted.');
1152: ELSE
1153: --if we're not splitting, just execute each work item serially. Here we call
1154: --the individual execute_ APIs so that we can do incremental complete and
1155: --commits after each one. This ensures we save our work as we go.

Line 1175: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

1171: l_return_msg);
1172:
1173: ELSE
1174: x_return_msg := 'Work Item ID('||px_work_queue(k).item_id||'), invalid work item type:'||px_work_queue(k).item_type;
1175: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1176: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1177: RETURN;
1178: END CASE;
1179:

Line 1176: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1172:
1173: ELSE
1174: x_return_msg := 'Work Item ID('||px_work_queue(k).item_id||'), invalid work item type:'||px_work_queue(k).item_type;
1175: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1176: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1177: RETURN;
1178: END CASE;
1179:
1180: --see if our work suceeded or not

Line 1208: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1204: --attach the failure message to the work item
1205: px_work_queue(k).item_msg := l_return_msg||px_work_queue(k).item_msg;
1206: --now return the error to the unit
1207: x_return_msg := 'Work Item with type('||px_work_queue(k).item_type||'),id('||px_work_queue(k).item_id||') failed: '||l_return_msg;
1208: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1209: RETURN;
1210: END IF;
1211:
1212: --at this point, the work item was sucessfully executed and its cache entry was removed, commit the work

Line 1218: fnd_oam_debug.log(1, l_ctxt, 'Rolling back changes because of non-standard run mode');

1214: --to mark our incremental success since we're the only worker.
1215: IF FND_OAM_DSCRAM_UTILS_PKG.RUN_IS_NORMAL THEN
1216: COMMIT;
1217: ELSE
1218: fnd_oam_debug.log(1, l_ctxt, 'Rolling back changes because of non-standard run mode');
1219: ROLLBACK;
1220: END IF;
1221: ELSE
1222: --the work failed, don't continue executing other work units in this case to cover

Line 1230: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1226: --now return the error
1227: x_return_status := l_return_status;
1228: --also push up the message so it shows up in a list of units
1229: x_return_msg := 'Work Item with type('||px_work_queue(k).item_type||'),id('||px_work_queue(k).item_id||') failed: '||l_return_msg;
1230: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1231: RETURN;
1232: END IF;
1233:
1234: --before getting the next work item, validate the unit and above to make sure

Line 1242: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1238: l_return_status,
1239: l_return_msg) THEN
1240: x_return_status := l_return_status;
1241: x_return_msg := l_return_msg;
1242: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1243: RETURN;
1244: END IF;
1245:
1246: --fetch the next work item

Line 1254: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1250:
1251: --if we got here, we're done.
1252:
1253: x_return_status := FND_API.G_RET_STS_SUCCESS;
1254: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1255: EXCEPTION
1256: WHEN OTHERS THEN
1257: -- include a safety rollback since this procedure calls other procedures that
1258: -- leave results on the main transaction.

Line 1262: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

1258: -- leave results on the main transaction.
1259: ROLLBACK;
1260: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1261: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';
1262: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1263: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1264: END;
1265:
1266: -- helper to EXECUTE_UNIT to handle the case where the topmost unit is a DML_SET type unit.

Line 1263: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1259: ROLLBACK;
1260: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1261: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';
1262: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1263: --fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1264: END;
1265:
1266: -- helper to EXECUTE_UNIT to handle the case where the topmost unit is a DML_SET type unit.
1267: -- responsibilities include querying out the dmls for the unit, preparing the structure used by

Line 1281: fnd_oam_debug.log(2, l_ctxt, 'ENTER');

1277:
1278: l_return_status VARCHAR2(6);
1279: l_return_msg VARCHAR2(2048);
1280: BEGIN
1281: fnd_oam_debug.log(2, l_ctxt, 'ENTER');
1282: x_return_status := FND_API.G_RET_STS_ERROR;
1283: x_return_msg := '';
1284:
1285: --get the list of dmls as a work queue

Line 1293: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1289: l_return_msg);
1290: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1291: x_return_status := l_return_status;
1292: x_return_msg := l_return_msg;
1293: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1294: RETURN;
1295: END IF;
1296:
1297: --execute the work queue

Line 1305: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1301: x_return_status,
1302: x_return_msg);
1303:
1304: --return status of the internal execute
1305: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1306: EXCEPTION
1307: WHEN OTHERS THEN
1308: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1309: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';

Line 1310: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

1306: EXCEPTION
1307: WHEN OTHERS THEN
1308: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1309: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';
1310: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1311: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1312: END;
1313:
1314: -- helper to EXECUTE_UNIT to handle the case where the topmost unit is a DML_SET type unit.

Line 1311: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1307: WHEN OTHERS THEN
1308: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1309: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';
1310: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1311: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1312: END;
1313:
1314: -- helper to EXECUTE_UNIT to handle the case where the topmost unit is a DML_SET type unit.
1315: -- responsibilities include querying out the dmls for the unit, preparing the structure used by

Line 1329: fnd_oam_debug.log(2, l_ctxt, 'ENTER');

1325:
1326: l_return_status VARCHAR2(6);
1327: l_return_msg VARCHAR2(2048);
1328: BEGIN
1329: fnd_oam_debug.log(2, l_ctxt, 'ENTER');
1330: x_return_status := FND_API.G_RET_STS_ERROR;
1331: x_return_msg := '';
1332:
1333: --get the list of plsqls as a work queue

Line 1341: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1337: l_return_msg);
1338: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1339: x_return_status := l_return_status;
1340: x_return_msg := l_return_msg;
1341: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1342: RETURN;
1343: END IF;
1344:
1345: --execute the work queue

Line 1352: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1348: x_work_queue_to_complete,
1349: x_return_status,
1350: x_return_msg);
1351:
1352: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1353: EXCEPTION
1354: WHEN OTHERS THEN
1355: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1356: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';

Line 1357: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

1353: EXCEPTION
1354: WHEN OTHERS THEN
1355: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1356: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';
1357: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1358: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1359: END;
1360:
1361: -- standard work item comparator, -1 if left scheduled earlier than right, 0 if same, 1 if right scheduled earlier.

Line 1358: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1354: WHEN OTHERS THEN
1355: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1356: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';
1357: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1358: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1359: END;
1360:
1361: -- standard work item comparator, -1 if left scheduled earlier than right, 0 if same, 1 if right scheduled earlier.
1362: -- takes into account the priority and then the weight with priority overriding weight. Null priorites come last,

Line 1405: fnd_oam_debug.log(1, l_ctxt, 'Q['||k||']: (P:'||p_work_queue(k).priority||')(W:'||p_work_queue(k).weight||') '||p_work_queue(k).item_id||'('||p_work_queue(k).item_type||')');

1401: k NUMBER;
1402: BEGIN
1403: k := p_work_queue.FIRST;
1404: WHILE k IS NOT NULL LOOP
1405: fnd_oam_debug.log(1, l_ctxt, 'Q['||k||']: (P:'||p_work_queue(k).priority||')(W:'||p_work_queue(k).weight||') '||p_work_queue(k).item_id||'('||p_work_queue(k).item_type||')');
1406: k := p_work_queue.NEXT(k);
1407: END LOOP;
1408: END;
1409:

Line 1441: fnd_oam_debug.log(2, l_ctxt, 'ENTER');

1437: m NUMBER;
1438: l_return_status VARCHAR2(6);
1439: l_return_msg VARCHAR2(2048);
1440: BEGIN
1441: fnd_oam_debug.log(2, l_ctxt, 'ENTER');
1442: x_return_status := FND_API.G_RET_STS_ERROR;
1443: x_return_msg := '';
1444:
1445: --first we need to fetch the component units of this meta-unit

Line 1471: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

1467: l_return_msg);
1468: ELSE
1469: --unknown unit type
1470: x_return_msg := 'Unknown unit type: '||l_types(k);
1471: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1472: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1473: RETURN;
1474: END CASE;
1475:

Line 1472: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1468: ELSE
1469: --unknown unit type
1470: x_return_msg := 'Unknown unit type: '||l_types(k);
1471: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1472: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1473: RETURN;
1474: END CASE;
1475:
1476: --see if the fetch suceeded, if not quick exit

Line 1480: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1476: --see if the fetch suceeded, if not quick exit
1477: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1478: x_return_status := l_return_status;
1479: x_return_msg := l_return_msg;
1480: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1481: RETURN;
1482: END IF;
1483:
1484: --debug

Line 1485: IF fnd_oam_debug.test(1) THEN

1481: RETURN;
1482: END IF;
1483:
1484: --debug
1485: IF fnd_oam_debug.test(1) THEN
1486: PRINT_WORK_QUEUE(l_work_queue);
1487: END IF;
1488:
1489: --merge the work items into the master ordered queue

Line 1492: fnd_oam_debug.log(1, l_ctxt, 'Replace');

1488:
1489: --merge the work items into the master ordered queue
1490: l_priority := l_priorities(k);
1491: IF l_master_work_queue.COUNT = 0 THEN
1492: fnd_oam_debug.log(1, l_ctxt, 'Replace');
1493: --master's empty, just replace it
1494: l_master_work_queue := l_work_queue;
1495: ELSE
1496: --if this unit has a later priority, just append

Line 1500: fnd_oam_debug.log(1, l_ctxt, 'Append');

1496: --if this unit has a later priority, just append
1497: IF ((l_last_unit_priority IS NOT NULL AND l_priority IS NULL) OR
1498: (l_last_unit_priority < l_priority)) THEN
1499:
1500: fnd_oam_debug.log(1, l_ctxt, 'Append');
1501: --since we're traversing the child units in order, set our finished_ubound to
1502: --the current end point, we can't find later units that need to insert before this point
1503: l_master_pos_finished_ubound := l_master_work_queue.COUNT;
1504:

Line 1522: fnd_oam_debug.log(1, l_ctxt, 'Merge: finished_ubound('||l_master_pos_finished_ubound||')');

1518: --queue is also sorted, we only need to perform one pass on both lists. Also, all entries before
1519: --the finishined_ubound are off limits since they are in an earlier unit priority.
1520: l_master_pos := l_master_work_queue.COUNT;
1521: j := l_work_queue.LAST;
1522: fnd_oam_debug.log(1, l_ctxt, 'Merge: finished_ubound('||l_master_pos_finished_ubound||')');
1523: WHILE j IS NOT NULL LOOP
1524: fnd_oam_debug.log(1, l_ctxt, 'Item('||j||'), initial master_pos('||l_master_pos||')');
1525: --loop till we find that the work item at master_pos is less than the current item, then set our pos
1526: --to be one past this previous item, stop when we go past the logical(possibly real) end of the master queue

Line 1524: fnd_oam_debug.log(1, l_ctxt, 'Item('||j||'), initial master_pos('||l_master_pos||')');

1520: l_master_pos := l_master_work_queue.COUNT;
1521: j := l_work_queue.LAST;
1522: fnd_oam_debug.log(1, l_ctxt, 'Merge: finished_ubound('||l_master_pos_finished_ubound||')');
1523: WHILE j IS NOT NULL LOOP
1524: fnd_oam_debug.log(1, l_ctxt, 'Item('||j||'), initial master_pos('||l_master_pos||')');
1525: --loop till we find that the work item at master_pos is less than the current item, then set our pos
1526: --to be one past this previous item, stop when we go past the logical(possibly real) end of the master queue
1527: WHILE l_master_pos > l_master_pos_finished_ubound LOOP
1528: IF COMPARE_WORK_ITEMS(l_master_work_queue(l_master_pos),

Line 1531: fnd_oam_debug.log(1, l_ctxt, 'Found position: '||l_master_pos);

1527: WHILE l_master_pos > l_master_pos_finished_ubound LOOP
1528: IF COMPARE_WORK_ITEMS(l_master_work_queue(l_master_pos),
1529: l_work_queue(j)) <= 0 THEN
1530: l_master_pos := l_master_pos + 1;
1531: fnd_oam_debug.log(1, l_ctxt, 'Found position: '||l_master_pos);
1532: EXIT;
1533: END IF;
1534: l_master_pos := l_master_work_queue.PRIOR(l_master_pos);
1535: END LOOP;

Line 1541: fnd_oam_debug.log(1, l_ctxt, 'Final position: '||l_master_pos);

1537: --if we didn't determine a spot, master pos must be reset to the first available slot
1538: IF l_master_pos <= l_master_pos_finished_ubound THEN
1539: l_master_pos := l_master_pos_finished_ubound + 1;
1540: END IF;
1541: fnd_oam_debug.log(1, l_ctxt, 'Final position: '||l_master_pos);
1542:
1543: --insert the work queue's item at l_master_pos by first moving everything from pos to count up one index
1544: m := l_master_work_queue.COUNT;
1545: l_master_work_queue.EXTEND(1);

Line 1570: IF fnd_oam_debug.test(1) THEN

1566: k := l_unit_ids.NEXT(k);
1567: END LOOP;
1568:
1569: --debug
1570: IF fnd_oam_debug.test(1) THEN
1571: fnd_oam_debug.log(1, l_ctxt, 'Master Work Queue:');
1572: PRINT_WORK_QUEUE(l_master_work_queue);
1573: END IF;
1574:

Line 1571: fnd_oam_debug.log(1, l_ctxt, 'Master Work Queue:');

1567: END LOOP;
1568:
1569: --debug
1570: IF fnd_oam_debug.test(1) THEN
1571: fnd_oam_debug.log(1, l_ctxt, 'Master Work Queue:');
1572: PRINT_WORK_QUEUE(l_master_work_queue);
1573: END IF;
1574:
1575: --at this point we have the finished work queue, just execute it

Line 1582: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1578: x_work_queue_to_complete,
1579: x_return_status,
1580: x_return_msg);
1581:
1582: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1583: EXCEPTION
1584: WHEN OTHERS THEN
1585: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1586: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';

Line 1587: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

1583: EXCEPTION
1584: WHEN OTHERS THEN
1585: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1586: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';
1587: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1588: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1589: END;
1590:
1591: -- Public, called once for the topmost unit

Line 1588: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1584: WHEN OTHERS THEN
1585: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1586: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';
1587: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1588: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1589: END;
1590:
1591: -- Public, called once for the topmost unit
1592: PROCEDURE EXECUTE_UNIT(p_unit_id IN NUMBER,

Line 1607: fnd_oam_debug.log(2, l_ctxt, 'ENTER');

1603: l_return_status VARCHAR2(6);
1604: l_return_msg VARCHAR2(2048);
1605: l_ignore VARCHAR2(2048);
1606: BEGIN
1607: fnd_oam_debug.log(2, l_ctxt, 'ENTER');
1608: x_return_status := FND_API.G_RET_STS_ERROR;
1609: x_return_msg := '';
1610:
1611: --make sure the unit's ok to start execution

Line 1617: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1613: l_return_status,
1614: l_return_msg) THEN
1615: x_return_status := l_return_status;
1616: x_return_msg := '[Unit Validation Failed]:('||l_return_msg||')';
1617: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1618: RETURN;
1619: END IF;
1620:
1621: -- attempt to assign this invocation as a worker for the unit

Line 1629: fnd_oam_debug.log(1, l_ctxt, x_return_msg);

1625: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1626: x_return_status := l_return_status;
1627: IF l_return_status <> FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_FULL THEN
1628: x_return_msg := '[Unit Worker Assignment Failed]:('||l_return_msg||')';
1629: fnd_oam_debug.log(1, l_ctxt, x_return_msg);
1630: END IF;
1631: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1632: RETURN;
1633: END IF;

Line 1631: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1627: IF l_return_status <> FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_FULL THEN
1628: x_return_msg := '[Unit Worker Assignment Failed]:('||l_return_msg||')';
1629: fnd_oam_debug.log(1, l_ctxt, x_return_msg);
1630: END IF;
1631: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1632: RETURN;
1633: END IF;
1634:
1635: --before proceeding after the assign, check our parent objects to make sure

Line 1649: fnd_oam_debug.log(1, l_ctxt, x_return_msg);

1645: FND_OAM_DSCRAM_UTILS_PKG.G_RET_STS_STOPPED,
1646: l_return_msg,
1647: x_return_status);
1648: x_return_msg := '[Post-Assignment Parent Validation Failed]:('||l_return_msg||')';
1649: fnd_oam_debug.log(1, l_ctxt, x_return_msg);
1650: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1651: RETURN;
1652: END IF;
1653:

Line 1650: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1646: l_return_msg,
1647: x_return_status);
1648: x_return_msg := '[Post-Assignment Parent Validation Failed]:('||l_return_msg||')';
1649: fnd_oam_debug.log(1, l_ctxt, x_return_msg);
1650: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1651: RETURN;
1652: END IF;
1653:
1654: -- after assign we can start using stuff from the unit_info package state. First, we need to

Line 1657: fnd_oam_debug.log(1, l_ctxt, 'Executing Unit...');

1653:
1654: -- after assign we can start using stuff from the unit_info package state. First, we need to
1655: -- see what type of unit we've got so we delegate to the right subfunction.
1656: l_return_status := FND_API.G_RET_STS_SUCCESS;
1657: fnd_oam_debug.log(1, l_ctxt, 'Executing Unit...');
1658:
1659: -- for now, just use the arg context of the run for execution, later we may want to introduce
1660: -- a specific task context that layers on top of the run context that lets units communicate
1661: -- values without affecting other tasks

Line 1665: IF fnd_oam_debug.test(1) THEN

1661: -- values without affecting other tasks
1662: FND_OAM_DSCRAM_RUNS_PKG.GET_RUN_ARG_CONTEXT(l_arg_context);
1663:
1664: -- in the lowest debug level, print the arg context
1665: IF fnd_oam_debug.test(1) THEN
1666: FND_OAM_DSCRAM_ARGS_PKG.PRINT_ARG_CONTEXT(l_arg_context);
1667: END IF;
1668:
1669: --delegate the work to different procedures based on the unit type

Line 1690: fnd_oam_debug.log(6, l_ctxt, l_return_msg);

1686: l_return_status,
1687: l_return_msg);
1688: ELSE
1689: l_return_msg := 'Unhandled Type:'||b_unit_info.unit_type;
1690: fnd_oam_debug.log(6, l_ctxt, l_return_msg);
1691: END CASE;
1692:
1693: --determine the status to apply to the unit from the execute's return status
1694: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN

Line 1714: fnd_oam_debug.log(1, l_ctxt, 'Finished Unit with status: '||l_completed_status||'('||l_return_status||')');

1710: END IF;
1711: END IF;
1712:
1713: --finished processing the unit
1714: fnd_oam_debug.log(1, l_ctxt, 'Finished Unit with status: '||l_completed_status||'('||l_return_status||')');
1715: COMPLETE_UNIT(b_unit_info.unit_id,
1716: l_completed_status,
1717: l_return_status,
1718: l_return_msg,

Line 1725: IF fnd_oam_debug.test(1) THEN

1721: l_work_queue_to_complete,
1722: x_return_status);
1723:
1724: -- in the lowest debug level, print the arg context
1725: IF fnd_oam_debug.test(1) THEN
1726: FND_OAM_DSCRAM_ARGS_PKG.PRINT_ARG_CONTEXT(l_arg_context);
1727: END IF;
1728:
1729: --if sucessfull, set the run arg context to our local context, can't modify object by reference

Line 1734: fnd_oam_debug.log(2, l_ctxt, 'EXIT');

1730: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
1731: FND_OAM_DSCRAM_RUNS_PKG.SET_RUN_ARG_CONTEXT(l_arg_context);
1732: END IF;
1733:
1734: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1735: EXCEPTION
1736: WHEN OTHERS THEN
1737: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';
1738: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

Line 1738: fnd_oam_debug.log(6, l_ctxt, x_return_msg);

1734: fnd_oam_debug.log(2, l_ctxt, 'EXIT');
1735: EXCEPTION
1736: WHEN OTHERS THEN
1737: x_return_msg := 'Unhandled Exception: [Code('||SQLCODE||'), Message("'||SQLERRM||'")]';
1738: fnd_oam_debug.log(6, l_ctxt, x_return_msg);
1739: --safety rollback
1740: ROLLBACK;
1741: COMPLETE_UNIT_IN_ERROR(p_unit_id,
1742: FND_OAM_DSCRAM_UTILS_PKG.G_STATUS_ERROR_UNKNOWN,