Skip Headers

Oracle Call Interface Programmer's Guide
Release 2 (9.2)

Part Number A96584-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

OCI Relational Functions, 7 of 38


OCIInitialize()

Purpose

Initializes the OCI process environment.

Syntax

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 _*/));

Parameters

mode (IN)

Specifies initialization of the mode. The valid modes are:

ctxp (IN)

User defined context for the memory call back routines.

malocfp (IN)

User-defined memory allocation function. If mode is OCI_THREADED, this memory allocation routine must be thread safe.

ctxp (IN/OUT)
Context pointer for the user-defined memory allocation function.
size (IN)
Size of memory to be allocated by the user-defined memory allocation function
ralocfp (IN)

User-defined memory re-allocation function. If mode is OCI_THREADED, this memory allocation routine must be thread safe.

ctxp (IN/OUT)
Context pointer for the user-defined memory reallocation function.
memptr (IN/OUT)
Pointer to memory block
newsize (IN)
New size of memory to be allocated
mfreefp (IN)

User-defined memory free function. If mode is OCI_THREADED, this memory free routine must be thread safe.

ctxp (IN/OUT)
Context pointer for the user-defined memory free function.
memptr (IN/OUT)
Pointer to memory to be freed

Comments


Note:

OCIEnvCreate() should be used instead of the OCIInitialize() and OCIEnvInit() calls. OCIInitialize() and OCIEnvInit() calls will be supported for backward compatibility.


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 (that is, 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.

Shared Data Structures Mode

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:

Example

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 );

Related Functions

OCIHandleAlloc(),OCIHandleFree(),OCIEnvCreate(),OCIEnvInit(), OCITerminate()


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback