Search code examples
c#.netoracleodp.net

Oracle Connection Pooling in .Net


We have a system that uses an Oracle database. I've been asked if the system makes use of connection pooling which I'm not sure about.

We are using the Oracle.DataAccess.Client.OracleConnection

When reading up on the subject I've found that connection pooling is set to true in the connection string and that it is set to true by default.

Our connection string does not include any pooling settings. Does this imply that we are using pooling and if so what would the default min and max pool size be? I've not been able to find any information on what these values would be in the case of using connection pooling implicitly (i.e. not specified in the connection string).


Solution

  • Connection pooling is turned on by default as specified in the official ODP.NET documentation on Connection String Attributes (default: Pooling = true).

    So, if your connection string omits any kind of connection pool setting, you will get a connection pool with the following basic default settings, again based on that same official ODP.NET documentation page on Connection String Attributes:

    • Connection Timeout = 15: Maximum time (in seconds) to wait for a free connection from the pool.
    • Decr Pool Size = 1: Number of connections that are closed when an excessive amount of established connections are unused.
    • Incr Pool Size = 5: Number of new connections to be created when all connections in the pool are in use.
    • Max Pool Size = 100: Maximum number of connections in a pool.
    • Min Pool Size = 1: Minimum number of connections in a pool.

    The documentation mentions other interesting default pool values as well that you may want to read about as well.