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, 16 of 38


OCISessionPoolCreate()

Purpose

Initializes a session pool. It starts up sessMin number of sessions and connections to the database. Before making this call, make a call to OCIHandleAlloc() to allocate memory for the session pool handle.

Syntax

sword OCISessionPoolCreate ( OCIEnv           *envhp,
                             OCIError         *errhp, 
                             OCISPool         *spoolhp,
                             OraText          **poolName,
                             ub4              *poolNameLen,
                             CONST OraText    *connStr,
                             ub4              connStrLen,
                             ub4              sessMin, 
                             ub4              sessMax, 
                             ub4              sessIncr,
                             OraText          *userid,
                             ub4              useridLen,
                             OraText          *password,
                             ub4              passwordLen,
                             ub4              mode );

Parameters

envhp (IN)

A pointer to the environment handle in which the session pool needs to be created.

errhp (IN/OUT)

An error handle which can be passed to OCIErrorGet().

spoolhp (IN/OUT)

A pointer to the session pool handle that is initialized.

poolName (OUT)

The name of the session pool returned. It is unique across all session pools in an environment. This value must be passed to the OCISessionGet() call.

poolNameLen (OUT)

Length of poolName in bytes.

connStr (IN)

The TNS alias of the database to connect to.

connStrLen (IN)

The length of connStr in bytes.

sessMin (IN)

Specifies the minimum number of sessions in the session pool.

This number of sessions are started by OCISessionPoolCreate(). After this, sessions are opened only when necessary.

This value is used when mode is set to OCI_SPC_HOMOGENEOUS. In all other cases it is ignored.

sessMax (IN)

Specifies the maximum number of sessions that can be opened in the session pool. Once this value is reached, no more sessions are opened. The valid values are 1 and above.

sessIncr (IN)

Allows applications to set the next increment for sessions to be started if the current number of sessions are less than sessMax. The valid values are 0 and above.

sessMin + sessIncr cannot be more than sessMax.

userid (IN)

Specifies the userid with which to start up the sessions.

See Also:

For more information about this parameter see "Authentication Note"



useridLen (IN)

Length of the userid in bytes.

password (IN)

The password for the corresponding userid.

passwordLen (IN)

The length of the password in bytes.

mode (IN)

The modes supported are

OCI_SPC_STMTCACHE - an OCI statement cache will be created for the session pool. If the pool is not created with OCI statement caching turned on, server-side statement caching will automatically be used. Please note that in general, client- side statement caching will give better performance.

See Also:

"Statement Caching"

Comments

Authentication Note

Please note that a session pool may contain two types of connections to the database: direct connections and proxy connections. To make a proxy connection, a user must have Connect through Proxy privilege.

See Also:

For more information on proxy connections, see

When the session pool is created, the userid and password may or may not be specified. If these values are null, no proxy connections can exist in this pool. If mode is set to OCI_SPC_HOMOGENEOUS, no proxy connection can exist.

A userid and password pair may also be specified through the authentication handle in the OCISessionGet() call. If this call is made with mode set to OCI_SESSGET_CREDPROXY, then the user is given a session that is authenticated by the userid provided in the OCISessionGet() call, through the proxy credentials supplied in the OCISessionPoolCreate() call. In this case, the password in the OCISessionGet() call is ignored.

If OCISessionGet() is called with mode not set to OCI_SESSGET_CREDPROXY, then the user gets a direct session which is authenticated by the credentials provided in the OCISessionGet() call. If none have been provided in this call, the user gets a session authenticated by the credentials in the OCISessionPoolCreate() call.

Related Functions

OCISessionRelease(), OCISessionGet(), OCISessionPoolDestroy()


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