Struct mimir::Pool [] [src]

pub struct Pool { /* fields omitted */ }

This structure represents session pools and is available by handle to a calling application or ' driver.

Methods

impl Pool
[src]

Acquires a connection from the pool and returns a reference to it. This reference should be released as soon as it is no longer needed.

  • username - the name of the user used for authenticating the user, as a string in the encoding used for CHAR data. None is also acceptable if external authentication is being requested or credentials were supplied when the pool was created.
  • password - the password to use for authenticating the user, as a string in the encoding used for CHAR data. None is also acceptable if external authentication is being requested or if credentials were supplied when the pool was created.
  • conn_create_params - An optional ConnCreate structure which is used to specify parameters for connection creation. None is acceptable in which case all default parameters will be used when creating the connection.

Adds a reference to the pool. This is intended for situations where a reference to the pool needs to be maintained independently of the reference returned when the pool was created.

Closes the pool and makes it unusable for further activity.

  • close_mode - one or more of the values from the enumeration ODPIPoolCloseMode, OR'ed together.

Creates a session pool which creates and maintains a group of stateless sessions to the database. The main benefit of session pooling is performance since making a connection to the database is a time-consuming activity, especially when the database is remote.

  • context - the context handle created earlier using the function Context::create().
  • username - the name of the user used for authenticating sessions, as a string in the encoding used for CHAR data. None is also acceptable if external authentication is being requested or if a heterogeneous pool is being created.
  • password - the password to use for authenticating sessions, as a string in the encoding used for CHAR data. None is also acceptable if external authentication is being requested or if a heterogeneous pool is being created.
  • connect_string - the connect string identifying the database to which connections are to be established by the session pool, as a string in the encoding used for CHAR data. None is also acceptable for local connections (identified by the environment variable ORACLE_SID).
  • common_create_params - a CommonCreate structure which is used to specify context parameters for pool creation. None is also acceptable in which case all default parameters will be used when creating the pool.
  • conn_create_params - a PoolCreate structure which is used to specify parameters for pool creation. None is also acceptable in which case all default parameters will be used for pool creation.

Returns the number of sessions in the pool that are busy.

Returns the encoding information used by the pool. This will be equivalent to the values passed when the pool was created, or the values retrieved from the environment variables NLS_LANG and NLS_NCHAR.

Returns the mode used for acquiring or getting connections from the pool.

Returns the maximum lifetime of all sessions in the pool, in seconds. Sessions in the pool are terminated when this value has been reached, but only when another session is released back to the pool.

Returns the number of sessions in the pool that are open.

Returns the default size of the statement cache for sessions in the pool, in number of statements.

Returns the amount of time, in seconds, after which idle sessions in the pool are terminated, but only when another session is released back to the pool.

Releases a reference to the pool. A count of the references to the pool is maintained and when this count reaches zero, the memory associated with the pool is freed and the session pool is closed if that has not already taken place using the function Pool::close().

Sets the mode used for acquiring or getting connections from the pool.

  • get_mode - A value from the ODPIGetMode enumeration.

Sets the maximum lifetime of all sessions in the pool, in seconds. Sessions in the pool are terminated when this value has been reached, but only when another session is released back to the pool.

  • max_lifetime - the maximum lifetime of all sessions in the pool, in seconds.

Sets the default size of the statement cache for sessions in the pool.

  • stmt_cache_size - the new size of the statement cache, in number of statements.

Sets the amount of time, in seconds, after which idle sessions in the pool are terminated, but only when another session is released back to the pool.

Trait Implementations

impl From<*mut ODPIPool> for Pool
[src]

Performs the conversion.