Search Results set_process




Overview

PA_DEBUG is the central diagnostic and logging utility package for the Oracle Projects (PA) application family in Oracle E-Business Suite. It provides a consistent, application-wide mechanism for developers and support personnel to emit debug messages, trace execution flow, write diagnostic output to files or the concurrent manager log, manage user-level concurrency locks, and collect and propagate error stacks. Because it abstracts the mechanics of debugging into a single reusable package, PA_DEBUG allows Projects PL/SQL code, concurrent programs, and Forms-based interfaces to share one logging convention rather than each implementing its own.

The package defines standard debug severity constants, including DEBUG_LEVEL_EXCEPTION (reserved for high-priority message reporting), DEBUG_LEVEL_NONE, DEBUG_LEVEL_BASIC, and DEBUG_LEVEL_TIMING. It also captures the standard "WHO" audit columns — user ID, login ID, concurrent request ID, and program identifiers — from FND_GLOBAL at package initialization, so that logged output is always attributable to a specific session and request. Public variables such as debug_flag, debug_level, and number_of_debug_messages control runtime behavior and expose message counts to calling code.

Key Procedures and Functions

  • INITIALIZE — Establishes the package's runtime state, including WHO columns and debug configuration, at the start of a session or program.
  • ENABLE_DEBUG / DISABLE_DEBUG — Turn debug message capture on or off for the session.
  • SET_DEBUG_LEVEL — Sets the active debug level so that only messages at or above the selected severity are recorded.
  • DEBUG / LOG_MESSAGE — Emit a debug message at the current level into the in-memory message buffer.
  • GET_MESSAGE / NO_OF_DEBUG_MESSAGES — Retrieve buffered messages and report how many have been captured.
  • SET_USER_LOCK_MODE, ACQUIRE_USER_LOCK, RELEASE_USER_LOCK — Manage user-level locking so that concurrent execution of a process is serialized safely.
  • SET_PROCESS — Defines the process context under which debug output and file writing occur. The default value of G_Process is 'IGNORE', so Forms that call Write_File without first invoking Set_Process remain unaffected.
  • WRITE_FILE / WRITE_LOG — Write captured diagnostic output to a file or to the concurrent manager log (FND_FILE.LOG by default).
  • INIT_ERR_STACK, SET_ERR_STACK, RESET_ERR_STACK, RAISE_ERROR — Initialize, populate, reset, and raise a structured error stack so that nested failures retain their context.
  • SET_CURR_FUNCTION / RESET_CURR_FUNCTION — Track the currently executing function name for more precise trace output.

Tables Accessed

PA_DEBUG does not read or write application data tables. Its documented references are to infrastructure objects accessed through APPS synonyms: DBMS_LOCK, used by the user-lock procedures; DUAL, for simple scalar queries; PLITBLM, referenced for PL/SQL internal table handling; and UTL_FILE, used when debug output is directed to an operating-system file rather than the concurrent log. Because persistence is limited to in-memory buffers and log or file output, the package imposes no DML overhead on Projects business tables.

Usage Notes

PA_DEBUG is most commonly invoked from Projects PL/SQL APIs, concurrent programs, and Oracle Forms when diagnostic tracing is required. Custom code can call SET_DEBUG_LEVEL and ENABLE_DEBUG before executing a process, then retrieve output via GET_MESSAGE or WRITE_FILE/WRITE_LOG. The package is a widely reused dependency — it is referenced by 473 other packages — so changes to it can have broad impact. The modification note regarding Set_Process and the 'IGNORE' default underscores that backward compatibility for existing Forms was an explicit design consideration. Developers should be aware that Set_Process governs process context, while Set_User_Lock_Mode, Acquire_User_Lock, and Release_User_Lock provide serialization for processes that cannot safely run in parallel.