Oracle Call Interface Programmer's Guide Release 9.0.1 Part Number A89857-01 |
|
OCI Relational Functions, 6 of 39
Initializes the OCI process environment.
sword OCIInitialize ( ub4 mode, CONST dvoid *ctxp, CONST dvoid *(*malocfp) (/* dvoid *ctxp, size_t size _*/), CONST dvoid *(*ralocfp) (/*_ dvoid *ctxp, dvoid *memptr, size_t newsize _*/), CONST void (*mfreefp) (/*_ dvoid *ctxp, dvoid *memptr _*/));
Specifies initialization of the mode. The valid modes are:
User defined context for the memory call back routines.
User-defined memory allocation function. If mode
is OCI_THREADED, this memory allocation routine must be thread safe.
Context pointer for the user-defined memory allocation function.
Size of memory to be allocated by the user-defined memory allocation function
User-defined memory re-allocation function. If mode
is OCI_THREADED, this memory allocation routine must be thread safe.
Context pointer for the user-defined memory reallocation function.
Pointer to memory block
New size of memory to be allocated
User-defined memory free function. If mode
is OCI_THREADED, this memory free routine must be thread safe.
Context pointer for the user-defined memory free function.
Pointer to memory to be freed
This call initializes the OCI process environment. OCIInitialize()
must be invoked before any other OCI call.
This function provides the ability for the application to define its own memory management functions through callbacks. If the application has defined such functions (i.e., memory allocation, memory re-allocation, memory free), they should be registered using the callback parameters in this function.
These memory callbacks are optional. If the application passes null values for the memory callbacks in this function, the default process memory allocation mechanism is used.
When a SQL statement is processed, certain underlying data is associated with the statement. This data includes information about statement text and bind data, as well as define and describe information for queries. This data remains the same from one execution of a statement to another, even if the statement is executed by different users.
When an OCI application is initialized in OCI_SHARED mode, common statement data is shared between multiple statement handles, thus providing memory savings for the application. This savings may be particularly valuable for applications which create multiple statement handles which execute the same SQL statement on different users' sessions, either on the same or multiple connections.
See Also:
|
The following statement shows an example of how to call OCIInitialize()
in both threaded and object mode, with no user-defined memory functions:
OCIInitialize((ub4) OCI_THREADED | OCI_OBJECT, (dvoid *)0, (dvoid * (*)()) 0, (dvoid * (*)()) 0, (void (*)()) 0 );
OCIHandleAlloc()
,
OCIHandleFree(),
OCIEnvCreate(),
OCIEnvInit(),
OCITerminate()
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|