Search Results set_fnd_session_date




Overview

GHR_SESSION is a low-level Oracle E-Business Suite PL/SQL package owned by the APPS schema that manages the session context and effective date information used by the Oracle Human Resources (HR) history framework. Its principal responsibility is to synchronize the effective date held in the FND_SESSIONS table with the effective date expected by the HR history APIs, thereby ensuring that date-tracked HR entities (assignments, positions, organizations, and related datetracked records) are queried and maintained against the correct effective point in time.

The package body carries the header $Header: ghstsess.pkb 120.2 2010/03/15, confirming it is a shipped product file delivered under the standard Oracle EBS release cycle. In ETRM it is classified as API classification OTHER — that is, it is an internal support package rather than a public, documented business API. The metadata records 18 other packages that reference GHR_SESSION, indicating that it is invoked indirectly by numerous HR and self-service components rather than being called directly by end users or external integrations.

Key Procedures and Functions

The documented interface exposes two procedures:

  • SET_SESSION_VAR_FOR_CORE — Establishes an entry in the FND_SESSIONS table for the current database session and initializes the HR history session variables for the "core" program context. It checks whether a row already exists for the current session, updating the stored effective date when it differs from the supplied value, or inserting a new session row when none is present. It then calls GHR_HISTORY_API.REINIT_G_SESSION_VAR and GHR_HISTORY_API.SET_G_SESSION_VAR to populate the session variable record with the program name "core" and the fire-trigger flag enabled.
  • SET_FND_SESSION_DATE — Identified in the source under bug reference 6127620. This procedure writes the effective date into the FND_SESSIONS record for the current session so that downstream code reading the session date operates at the correct effective point. It relies on the same session-lookup and existence-check pattern used by SET_SESSION_VAR_FOR_CORE, relying on the current session identifier returned by USERENV in DUAL.

The user search term "set_fnd_session_date" corresponds directly to the second procedure, which is the entry point most commonly associated with this package.

Tables Accessed

GHR_SESSION operates against two documented tables accessed through APPS synonyms:

  • FND_SESSIONS — The core Oracle EBS session registry. GHR_SESSION reads the existing row for the current session to determine whether an effective date is present, inserts a new row when one is absent, and updates the EFFECTIVE_DATE column when the stored value differs from the requested effective date. This table is the persistent anchor for the session-level effective date.
  • DUAL — Used to obtain the current session identifier via USERENV('sessionid'), which keys all subsequent reads and writes against FND_SESSIONS.

Usage Notes

GHR_SESSION is not intended for direct invocation by end users. It is called internally by HR-related packages whenever a session needs its effective date established or refreshed — for example, when an HR form or self-service page opens a datetracked entity, or when a concurrent process must resolve date-tracked data at a defined effective point. Because it manipulates FND_SESSIONS, which is shared across the application, customizations should not call these procedures indiscriminately; altering the session effective date affects every subsequent date-tracked read within the same database session.

Custom code that must align the HR history framework to a specific effective date should ideally use the supported HR history APIs rather than invoking GHR_SESSION directly, and any direct use should restore or reinitialize the session state afterward. The package is present and functionally consistent in both EBS 12.1.1 and 12.2.2, though the supported and recommended pattern remains delegation through the HR history API layer.