Search Results lock_sourcing_rules
Overview
PO_LOCKS is an internal Oracle Purchasing package in Oracle E-Business Suite (Release 12.1.1 and 12.2.2) whose primary responsibility is the acquisition and management of document-level locks within the purchasing transaction model. Purchasing documents — requisitions, purchase orders, releases, and their associated distributions — are subject to concurrent access by multiple users, forms sessions, and concurrent programs. Without a controlled locking mechanism, two sessions could modify the same header or distribution simultaneously, leading to lost updates, overstated quantities, or inconsistent document state. PO_LOCKS provides the programmatic interface through which calling code reserves ownership of one or more header or distribution records before performing updates.
The package is declared with AUTHID CURRENT_USER, meaning its SQL statements execute under the privileges of the invoking session rather than the package owner, consistent with Oracle EBS security conventions for shared application code. It is classified in the ETRM metadata as an OTHER API, indicating that it is not a public, supported business API but rather an internal utility invoked by other Purchasing components.
Key Procedures and Functions
- LOCK_HEADERS — Acquires locks against purchasing document headers at a specified document type and document level, operating over a collection of identifiers supplied by the caller. It is used when a session intends to modify header-level attributes of requisitions, purchase orders, or releases.
- LOCK_DISTRIBUTIONS — Acquires locks against the distribution lines belonging to a purchasing document. This is invoked when distribution-level changes (quantity, price, accounting, or receipt matching attributes) are about to be applied.
- LOCK_SOURCING_RULES — Acquires locks against sourcing rule definitions held in MRP_SOURCING_RULES, protecting sourcing setup from concurrent modification during purchasing activity.
Each procedure accepts a document type, a document level, and a table of identifiers (po_tbl_number), allowing batch locking of many records in a single call. The package does not expose functions in the documented metadata.
Tables Accessed
The package references its operational tables through APPS synonyms:
- PO_HEADERS_ALL — the base table for purchase order headers whose rows are locked.
- PO_RELEASES_ALL — represents blanket agreement releases subject to header-level locking.
- PO_DISTRIBUTIONS_ALL — the distribution table targeted by LOCK_DISTRIBUTIONS.
- PO_REQUISITION_HEADERS_ALL and PO_REQ_DISTRIBUTIONS_ALL — extend the locking scope to requisitions and their distributions.
- MRP_SOURCING_RULES — sourcing rule definitions protected by LOCK_SOURCING_RULES.
- PO_SESSION_GT and PO_SESSION_GT_S — a global temporary table (and its synonym) used to hold session-scoped identifier lists during the locking operation.
- PLITBLM — the PL/SQL integer table type used to marshal identifier collections.
- DUAL — used for scalar validation and control queries.
Usage Notes
PO_LOCKS is not intended for direct invocation by end users or customer-written code. It is called internally by other Purchasing packages — the metadata records four dependent packages — and is typically reached through the Purchasing forms (for example, the Purchase Orders and Requisitions windows) and through concurrent programs that process documents in batch. The pattern is consistent: before a form or program performs DML on a header or distribution, it calls the appropriate lock procedure so that competing sessions cannot interleave updates. The p_doc_type and p_doc_level parameters allow the same routine to serve requisitions, orders, and releases, while p_doc_level_id_tbl permits multi-record locking. Because the package is unsupported for external use and its specification is version-stamped (115.0, 2003), any customization should treat PO_LOCKS as an implementation detail of Oracle Purchasing and should not be called or replaced directly.