Connection Pool

This topic provides overview of the Connection Pool settings. A connection pool is a set of database connections that are re-used by clients. Setting up a connection pool improves performance by eliminating client connection times and it is also the preferred method of handling database connections since it provides a more robust handling of error conditions and lost connections than direct manipulation of the connection objects. The default values for various connection pool settings for your Telerik Data Access application can be set using this section of the dialog.

  • Use Telerik Data Access Connection Pool - the connection pool and management features of Telerik Data Access are used. Driver specific connection pooling is turned off and the connection string is modified. Setting this option to True will enable the Telerik Data Access Connection Pool group. When Telerik Data Access Integrated Connection Pool pooling is set, Telerik Data Access will handle the Connection Pool internally. Additional features like reserved connections (used for the key generation mechanism) will be handled with these settings. When using the Telerik Data Access Connection Pool you could make use of all the features provided in the dialog.

    To not get in conflict with the underlying driver, Telerik Data Access makes some additions to the connection string that is provided by the user. They can be overridden by the user, because the Telerik Data Access additions are added to the beginning of the connection string. The driver will accept the last property that was specified. For more information, please refer to How to: Use the Telerik Data Access Integrated Connection Pool.

  • Use Telerik Data Access Connection Pool with Telerik Data Access Connection Management - plain ADO connections are used. The management features of Telerik Data Access are used. Driver specific connection pooling is usable.

  • Use ADO Connection Pool - plain ADO connections are used. The management features of Telerik Data Access are turned off. Driver specific connection pooling is usable.

Telerik Data Access Connection Management

The Telerik Data Access Connection Management group is enabled when either the Use Telerik Data Access Connection Pool or the Use Telerik Data Access Connection Pool with Telerik Data Access Connection Management option is selected.

  • Block When Full - controls the behavior of the empty connection pool when a new connection is requested. If this property is set to True, threads attempting to obtain a connection will wait, until one is available. Default value is True.
  • Active Connection Timeout (sec) - sets the number of seconds after which, active connections that have been inactive or busy are closed. The default value is 120 seconds. If you need connections to remain open for an unlimited timespan (until the OpenAccessContext.Dispose() method is called), you should set the connection timeout to 0.
  • Init SQL - specifies an SQL statement to be executed on each newly created connection. This can be used for application role restrictions. This property can be used in a generic way to provide a connection with a customer specific setup.
  • Maximum Connections Used - sets the maximum number of connections to create for the connection pool. If you set this to 10 then Telerik Data Access will not open more than 10 connections to the database. You need to use the event log to monitor your production system to decide how many connections you need. This depends on the transaction mode (optimistic or pessimistic), the length of your transactions and the number of users. Default value is 10.
  • KeyGen Reserved Connections - the number of connections to reserve for primary key generation. This prevents deadlocks on commit. The name of this property is reserved and its default value is set at 1.

Pool Size

  • Maximum Idle Connections - sets the maximum number of idle connections to be kept in the pool. Setting this to a number lower than the number set in "Maximum Active Connections" will cause the pool to shrink during idle periods. Its default value is set at 10.
  • Minimum Idle Connections - new connections are created by a background thread if the number of idle connections in the pool is less than this setting. This improves response time when the load on the server is increasing. Its default value is set at 2.
  • Prepared Statement Cache - specifies whether to cache PreparedStatemends per connection or not. The default value is True.
  • Prepared Statement Cache Size - the number of statements to store in the prepared statement cache. The default value is 0 = unlimited.

Connection Health

  • Test On Allocation - when this property is set to True, then each connection is validated before leaving the pool. This may have a serious negative impact on performance, so this property is set by default to False.
  • Test On Release - when this property is set to True then each connection is validated before being returned to the pool. This may have a serious negative impact on performance, so this property is set by default to False.
  • Test On Exception - when this property is set to True then connections involved in an exception thrown by Telerik Data Access are validated before being returned to the pool. By default it is set to True.
  • Test When Idle - when this property is set to True then idle connections are tested periodically by a background thread. Connections that fail the validation process are discarded. By default it is set to True.
  • Test When Idle Interval (sec) - sets the number of seconds between idle connection test runs and active connection timeout checks. Its default value is set at 120 seconds.
  • Max Connection Age - controls the maximum number of times a connection can be returned to the connection pool before it is closed to free accumulated resources.
  • Connect Retry Count - if Telerik Data Access throws an exception for a connect() call the operation will be retried for the set number of times (0 for infinite, -1 for no retries). When the retries are exhausted the exception will propagate to the application. The default value for this property is 30.
  • Connect Retry Interval (msec) - sets the number of milliseconds the pool will sleep between retries for the connect() exceptions. Its default value is set at 1000 milliseconds, i.e, by default a connection will try for one second before giving up.