Oracle® Database PL/SQL Language Reference 11g Release 2 (11.2) Part Number E10472-02 |
|
|
View PDF |
The SERIALLY_REUSABLE
pragma specifies that the package state is needed for only one call to the server (for example, an OCI call to the database or a stored procedure call through a database link). After this call, the storage for the package variables can be reused, reducing the memory overhead for long-running sessions.
This pragma is appropriate for packages that declare large temporary work areas that are used once in the same session.
Topics:
Syntax
serially_resuable_pragma ::=
Usage
The SERIALLY_REUSABLE
pragma can appear in the specification of a bodiless package, or in both the specification and body of a package. The pragma cannot appear only in the body of a package.
The global memory for serially reusable packages is pooled in the System Global Area (SGA), not allocated to individual users in the User Global Area (UGA). When the call to the server ends, the memory returns to the pool. Each time the package is used, its public variables are set to their initial values (if any) or to NULL
.
Trying to access a serially reusable package from a database trigger or from a PL/SQL subprogram that was invoked from a SQL statement causes an error.
Examples
Example 10-2, "Serially Reusable Package Specification and Package Body"
Example 10-3, "Open Cursors in Serially Reusable Packages at Call Boundaries"
Related Topics
In this chapter:
In other chapters: