dpiPoolCreateParams

Struct dpiPoolCreateParams 

Source
#[repr(C)]
pub struct dpiPoolCreateParams {
Show 18 fields pub minSessions: u32, pub maxSessions: u32, pub sessionIncrement: u32, pub pingInterval: c_int, pub pingTimeout: c_int, pub homogeneous: c_int, pub externalAuth: c_int, pub getMode: dpiPoolGetMode, pub outPoolName: *const c_char, pub outPoolNameLength: u32, pub timeout: u32, pub waitTimeout: u32, pub maxLifetimeSession: u32, pub plsqlFixupCallback: *const c_char, pub plsqlFixupCallbackLength: u32, pub maxSessionsPerShard: u32, pub accessTokenCallback: dpiAccessTokenCallback, pub accessTokenCallbackContext: *mut c_void,
}
Expand description

This structure is used for creating session pools, which can in turn be used to create connections that are acquired from that session pool. All members are initialized to default values using the dpiContext_initPoolCreateParams() function.

Fields§

§minSessions: u32

Specifies the minimum number of sessions to be created by the session pool. This value is ignored if the [dpiPoolCreateParams.homogeneous] member has a value of 0. The default value is 1.

§maxSessions: u32

Specifies the maximum number of sessions that can be created by the session pool. Values of 1 and higher are acceptable. The default value is 1.

§sessionIncrement: u32

Specifies the number of sessions that will be created by the session pool when more sessions are required and the number of sessions is less than the maximum allowed. This value is ignored if the [dpiPoolCreateParams.homogeneous] member has a value of 0. This value added to the [dpiPoolCreateParams.minSessions] member value must not exceed the [dpiPoolCreateParams.maxSessions] member value. The default value is 0.

§pingInterval: c_int

Specifies the number of seconds since a connection has last been used before a ping will be performed to verify that the connection is still valid. A negative value disables this check. The default value is 60.

§pingTimeout: c_int

Specifies the number of milliseconds to wait when performing a ping to verify the connection is still valid before the connection is considered invalid and is dropped. The default value is 5000 (5 seconds).

§homogeneous: c_int

Specifies whether the pool is homogeneous or not. In a homogeneous pool all connections use the same credentials whereas in a heterogeneous pool other credentials are permitted. The default value is 1.

§externalAuth: c_int

Specifies whether external authentication should be used to create the sessions in the pool. If this value is 0, the user name and password values must be specified in the call to dpiPool_create(); otherwise, the user name and password values must be zero length or NULL. The default value is 0. External authentication cannot be used with homogeneous pools.

§getMode: dpiPoolGetMode

Specifies the mode to use when sessions are acquired from the pool. It is expected to be one of the values from the enumeration dpiPoolGetMode. The default value is DPI_MODE_POOL_GET_NOWAIT. This value can be set after the pool has been created using the function dpiPool_setGetMode() and acquired using the function dpiPool_getGetMode().

§outPoolName: *const c_char

This member is populated upon successful creation of a pool using the function dpiPool_create(). It is a byte string in the encoding used for CHAR data. Any value specified prior to creating the session pool is ignored.

§outPoolNameLength: u32

This member is populated upon successful creation of a pool using the function dpiPool_create(). It is the length of the [dpiPoolCreateParams.outPoolName] member, in bytes. Any value specified prior to creating the session pool is ignored.

§timeout: u32

Specifies the length of time (in seconds) after which idle sessions in the pool are terminated. Note that termination only occurs when the pool is accessed. The default value is 0 which means that no idle sessions are terminated. This value can be set after the pool has been created using the function dpiPool_setTimeout() and acquired using the function dpiPool_getTimeout().

§waitTimeout: u32

Specifies the length of time (in milliseconds) that the caller should wait for a session to become available in the pool before returning with an error. This value is only used if the [dpiPoolCreateParams.getMode] member is set to the value DPI_MODE_POOL_GET_TIMEDWAIT. The default value is 0. This value can be set after the pool has been created using the function dpiPool_setWaitTimeout() and acquired using the function dpiPool_getWaitTimeout().

§maxLifetimeSession: u32

Specifies the maximum length of time (in seconds) a pooled session may exist. Sessions in use will not be closed. They become candidates for termination only when they are released back to the pool and have existed for longer than maxLifetimeSession seconds. Session termination only occurs when the pool is accessed. The default value is 0 which means that there is no maximum length of time that a pooled session may exist. This value can be set after the pool has been created using the function dpiPool_setMaxLifetimeSession() and acquired using the function dpiPool_getMaxLifetimeSession().

§plsqlFixupCallback: *const c_char

Specifies the name of a PL/SQL procedure in the format schema.package.callback_proc which will be called when a session is checked out from the pool and the requested tag doesn’t match the actual tag assigned to the session. The procedure accepts the desired and actual tags as parameters and it is the responsibility of the procedure to ensure that the session matches the desired state upon completion. See the OCI documentation for more information. The value is expected to be a byte string in the encoding used for CHAR data. This functionality is only available when Oracle Client is at version 12.2 and higher.

§plsqlFixupCallbackLength: u32

Specifies the length of the PL/SQL fixup callback, in bytes.

§maxSessionsPerShard: u32

Specifies the maximum number of sessions that can be created by the session pool for each shard in a sharded database. Set this attribute to a value other than zero to ensure that the pool is balanced towards each shard. A value of zero will not set any maximum number of sessions for each shard. If the Oracle client library version is less than 18.3, this value is ignored.

§accessTokenCallback: dpiAccessTokenCallback

The callback function which will get called by the connection pool if the pool needs to expand and create new connections but the current authentication token has expired.

The function should get a new authentication token and then set [dpiAccessToken.token] and [dpiAccessToken.privateKey] in the accessToken argument. The authentication token can be generated by invoking the Oracle Cloud Infrastructure (OCI) Command Line Interface (CLI).

The function should return DPI_SUCCESS for success and DPI_FAILURE for failure. Returning DPI_FAILURE will cause the connection to fail and return ORA-01017 to the application.

The callback accepts the following arguments:

§accessTokenCallbackContext: *mut c_void

Specifies the value that will be used as the first argument to the callback specified in the [dpiPoolCreateParams.accessTokenCallback] member. The default value is NULL.

Trait Implementations§

Source§

impl Clone for dpiPoolCreateParams

Source§

fn clone(&self) -> dpiPoolCreateParams

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for dpiPoolCreateParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for dpiPoolCreateParams

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for dpiPoolCreateParams

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.