Search Results get_gen_bal_context




Overview

XLA_CONTEXT_PKG is the context management package for the Oracle Subledger Accounting (XLA) application within Oracle E-Business Suite. It is owned by the APPS schema and, as declared with AUTHID CURRENT_USER, executes with the privileges of the invoking user rather than its definer, so that security context and session state are resolved correctly for the calling session. Its stated purpose is to set attribute values for the application context namespace "XLA".

In EBS, application contexts are lightweight session-level variables maintained through DBMS_SESSION. XLA uses this namespace to carry transient state across PL/SQL call boundaries within a single database session. XLA_CONTEXT_PKG provides a controlled, packaged API for populating, reading, and clearing those attributes, allowing subledger accounting programs to communicate state without persistent storage. The package was originally created in 2003 and later extended to support Multiple Reporting Currencies (MPA) reporting changes and additional event-related context attributes. It is referenced by 49 other packages, confirming its role as shared infrastructure across subledger accounting, accounting error handling, and period-end processing flows.

Key Procedures and Functions

The documented API comprises twenty-five procedures and functions, organized by the context attribute they manage:

Each convention follows a setter/getter/clearer pattern. Setters accept a client identifier, getters return a scalar value, and the clear routines (including CLEAR_EVENT_CONTEXT, which the user searched for) reset the attribute so that stale session state does not leak into subsequent operations. Because the attributes live in the session, correct pairing of set and clear calls is essential.

Tables Accessed

The metadata records two underlying dependencies, both accessed through APPS synonyms: DBMS_LOCK and DBMS_SESSION. There are no application tables directly referenced; the package is deliberately lightweight.

  • DBMS_SESSION provides the mechanism for manipulating the XLA application context namespace, setting and clearing session attributes.
  • DBMS_LOCK provides serialization, protecting context values from concurrent modification where multiple processes may act on the same session-visible state.

Usage Notes

XLA_CONTEXT_PKG is invoked programmatically rather than by end users. Typical callers are Subledger Accounting concurrent programs, Create Accounting derivatives, MPA reporting processes, and customizations that need to communicate state into or out of XLA APIs. The package is not a form-level API; it is designed to be called from PL/SQL within the same session that will subsequently read the context.

When invoked from custom code, the recommended pattern is to set the required context before calling an XLA routine and to call the corresponding clear procedure afterward, ideally in exception handlers, to prevent residual values from affecting later processing. The presence of CLEAR_EVENT_CONTEXT alongside the event setters reflects this discipline for event-related attributes. Callers must also ensure the session is the intended one, since context values are not transactional and do not roll back.