Search Results set_err_stack
Overview
APPS.EAM_DEBUG is a diagnostic instrumentation package body shipped as part of the Oracle Enterprise Asset Management (eAM) module in Oracle E-Business Suite 12.1.1 and 12.2.2. Its documented header comment indicates that the source was copied from the Oracle Projects (PA) debug framework (PA_DEBUG), a pattern Oracle has historically reused across product families to provide a consistent, low-overhead tracing facility. The package serves no business transaction function; rather, it provides eAM development and support teams with a controlled mechanism for capturing internal execution traces, timing information, exception context, and error stacks during the execution of eAM processing logic.
In Oracle EBS terms this object is classified as API classification OTHER, reflecting that it is an internal utility rather than a published business API. Documented metadata lists 27 procedures and functions, meaning the package is a full debugging toolkit rather than a single-purpose utility. Because it is a package body owned by APPS, other eAM packages can call it directly, and the ETRM metadata records that it is referenced by four other packages within the application.
Key Procedures and Functions
The documented procedures divide into several functional groups:
- Lifecycle and level control: INITIALIZE, ENABLE_DEBUG (both overloaded forms), DISABLE_DEBUG, and SET_DEBUG_LEVEL establish whether tracing is active and at what verbosity. The body excerpt shows a BOOLEAN debug_flag plus a numeric debug_level, with named constants such as DEBUG_LEVEL_BASIC, DEBUG_LEVEL_TIMING, and DEBUG_LEVEL_EXCEPTION.
- Message emission: DEBUG (in both single-argument and message-plus-level overloads), LOG_MESSAGE, and WRITE_LOG. The DEBUG overloads write only when the active debug_level meets or exceeds the requested x_debug_level, and the timing mode prefixes messages with a SYSDATE timestamp. Long messages are chunked into 255-byte rows of a PL/SQL table.
- Message retrieval: GET_MESSAGE and NO_OF_DEBUG_MESSAGES read back buffered messages and the count of buffered entries, supporting test harnesses and diagnostic reports.
- Error stack handling: INIT_ERR_STACK, SET_ERR_STACK, and RESET_ERR_STACK maintain a stack of error context. SET_ERR_STACK is the entry point most commonly sought by developers, as it appends the current error context to the stack for later retrieval and logging.
- Error raising and logging: RAISE_ERROR and the WRITE_FILE procedure for file-based output.
- Concurrency control: SET_USER_LOCK_MODE, ACQUIRE_USER_LOCK, and RELEASE_USER_LOCK, which govern serialization of debug output across concurrent sessions.
- Execution context markers: SET_PROCESS, SET_CURR_FUNCTION, and RESET_CURR_FUNCTION, which label the currently executing process and function so that emitted messages can be attributed correctly.
Tables Accessed
The documented table references are DBMS_LOCK, DUAL, PLITBLM, and UTL_FILE. These are not application data tables. DBMS_LOCK is invoked via the user-lock procedures to serialize debug output; DUAL supports trivial single-row queries and timestamp retrieval; PLITBLM is the underlying index-by table used for the in-memory debug message buffer; and UTL_FILE supports the WRITE_FILE and logging routines that write trace output to an operating-system file on the database server. No eAM business tables are read or written by this package.
Usage Notes
EAM_DEBUG is invoked programmatically from other eAM PL/SQL packages, forms-based server-side logic, concurrent program bodies, and custom extensions rather than through a user-facing screen. A typical pattern is to call SET_CURR_FUNCTION at entry, emit DEBUG or LOG_MESSAGE calls at decision points, invoke SET_ERR_STACK inside exception handlers to capture the error context, and finally drive output via WRITE_FILE or WRITE_LOG. Because tracing is gated by debug_flag and debug_level, the package imposes negligible overhead when debugging is disabled, making it safe to leave instrumentation calls in production code.
-
PACKAGE BODY: APPS.EAM_DEBUG
12.2.2
-
PACKAGE BODY: APPS.EAM_DEBUG
12.1.1
-
PACKAGE BODY: APPS.PA_DEBUG
12.2.2
-
PACKAGE BODY: APPS.PA_DEBUG
12.1.1
-
PACKAGE BODY: APPS.PN_DEBUG
12.2.2
-
PACKAGE: APPS.EAM_DEBUG
12.1.1
-
PACKAGE: APPS.PA_DEBUG
12.2.2
-
PACKAGE: APPS.PN_DEBUG
12.2.2
-
PACKAGE: APPS.EAM_DEBUG
12.2.2
-
PACKAGE: APPS.PA_DEBUG
12.1.1
-
APPS.EAM_DEBUG dependencies on EAM_DEBUG
12.1.1
-
APPS.EAM_DEBUG dependencies on EAM_DEBUG
12.2.2
-
APPS.PN_DEBUG dependencies on PN_DEBUG
12.2.2
-
APPS.PA_DEBUG dependencies on PA_DEBUG
12.2.2
-
APPS.PA_DEBUG dependencies on PA_DEBUG
12.1.1