Search Results nowaitlock_fetch_pk




Overview

ARP_DISTRIBUTIONS_PKG is a low-level data access package in the Oracle E-Business Suite Receivables (AR) module, owned by the APPS schema. It encapsulates the create, read, update, delete, and locking operations against the AR_DISTRIBUTIONS table, which stores the accounting distribution lines generated for Receivables transactions, receipts, adjustments, and related accounting events. In Oracle EBS 12.1.1 and 12.2.2 the package is classified as an "OTHER" API rather than a formally supported public API, meaning it is intended primarily for internal use by other Receivables packages and by the Subledger Accounting (SLA) and accounting generation flows that populate distribution records. Its principal design goal is to provide a single, consistent point of maintenance for row-level DML and concurrency control on the AR_DISTRIBUTIONS entity, isolating callers from the physical table and its synonyms.

Key Procedures and Functions

The package exposes eight documented procedures, all declared with AUTHID CURRENT_USER, which causes them to execute with the privileges of the invoking user rather than the definer.

  • INSERT_P — Inserts a new AR_DISTRIBUTIONS row from a supplied record and returns the generated line identifier through an OUT parameter.
  • UPDATE_P — Updates an existing distribution row using the values supplied in the record parameter.
  • DELETE_P — Removes the distribution row identified by the given line identifier.
  • LOCK_P — Acquires a row-level lock on the distribution identified by line identifier, used to serialize concurrent modification.
  • FETCH_P — Retrieves a single distribution record by line identifier.
  • FETCH_PK — Retrieves a distribution record using the natural composite key of source identifier, source table, and source type, rather than the surrogate line identifier.
  • LOCK_FETCH_PK — Combines locking and retrieval in a single call, waiting if necessary to obtain the lock before returning the row.
  • NOWAITLOCK_FETCH_PK — Performs the same lock-and-fetch operation by composite key but returns immediately if the row is already locked, allowing callers to avoid blocking.

Tables Accessed

The package operates against AR_DISTRIBUTIONS and its sequence-backed synonym AR_DISTRIBUTIONS_S, which supplies the line identifiers used by INSERT_P. AR_SYSTEM_PARAMETERS is referenced to obtain Receivables system-level setup values needed during distribution processing, and DUAL is used for scalar evaluations. In practice, the source table and source type columns on AR_DISTRIBUTIONS identify which parent accounting entity — such as a transaction line, receipt, or adjustment — a given distribution belongs to, which is why the composite-key fetch procedures are central to normal usage.

Usage Notes

Because it is an internal "OTHER" API, ARP_DISTRIBUTIONS_PKG is normally invoked indirectly. It is referenced by eleven other packages within the Receivables application, which call it during accounting distribution generation, subledger transfer, and adjustment processing rather than exposing it to end users directly. Oracle Forms and concurrent programs do not typically call the package directly; instead they invoke the higher-level Receivables APIs and concurrent managers that in turn use these procedures. Custom code should treat the package as undocumented and subject to change between point releases, and should prefer the supported Receivables public APIs (for example, AR_INVOICE_API_PUB or AutoAccounting-derived flows) wherever equivalent functionality exists. Where direct use is unavoidable, callers must supply a fully populated AR_DISTRIBUTIONS record, handle the OUT parameters correctly, and rely on LOCK_P, LOCK_FETCH_PK, or NOWAITLOCK_FETCH_PK to manage concurrency rather than issuing their own SELECT FOR UPDATE statements.