Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
Pool Settings
Programmer's Guide > OpenAccess ORM Classic (Old API) > Programming With OpenAccess > Connection Pool Configuration > Pool Settings

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

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. In OpenAccess ORM, connection pool settings can be configured using the App.config or Web.config file. The pool settings can be specified within the <backendconfigurations> section of the file. An example of the same is given below:

XML Copy Code
<backendconfigurations>
  
<backendconfiguration id="mssqlConfiguration" backend="mssql">
    
<maxConAge>100</maxConAge>
  
</backendconfiguration>
<
backendconfigurations>

Alternatively, you could use the Backend Configuration Settings dialog (from the Telerik menu, select OpenAccess -> Configuration -> Backend Configuration Settings).

  • Active connection timeout (secs) - specifies the number of seconds after which, active connections that have been inactive or busy are closed. Its default value is set at 120 seconds. The name of this setting in the App.config file is <conTimeout>.
  • Block when full - when this property is set to True (its default value), then threads attempting to obtain a connection will wait, until one is available. If it is set to False, an exception will be thrown. The name of this setting in the App.config file is <blockWhenFull>.
  • Connect retry count - if OpenAccess 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. The name of this setting in the App.config file is <retryCount>.
  • Connect retry interval (ms) - 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. The default value for this property is 1000ms. The name of this setting in the App.config file is <retryIntervalMs>.
  • Connection 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. The name of this setting in the App.config file is <initSql>.
  • Connection validation SQL - specifies the SQL query to be executed when a connection is validated. This must return at least one row. If nothing is specified then OpenAccess will supply a suitable query. The name of this setting in the App.config file is <validateSql>.
  • Lock timeout - specifies the time (in ms) after which lock request will timeout. The default value is 5000. The name of this setting in the App.config file is <lockTimeout>.
  • 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. The name of this setting in the App.config file is <maxConAge>.
  • Pool max active - sets the maximum number of connections to create for the connection pool. If you set this to 10 then OpenAccess 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. Its default value is set at 10. The name of this setting in the App.config file is <maxActive>.
  • Pool max idle - sets the maximum number of idle connections to be kept in the pool. Setting this to a number lower than the number set in "Pool max active" will cause the pool to shrink during idle periods. Its default value is set at 10. The name of this setting in the App.config file is <maxIdle>.
  • Pool min idle - 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. The name of this setting in the App.config file is <minIdle>.
  • Pool reserved - sets the number of connections to reserve for primary key generation. This prevents deadlocks on commit. Its default value is set at 1. The name of this setting in the App.config file is <reserved>.
  • Pool test interval (secs) - sets the number of seconds between idle connection test runs and active connection timeout checks. Its default value is set at 120 seconds. The name of this setting in the App.config file is <testInterval>.
  • PreparedStatement cache size limit - sets the maximum number of PreparedStatements to cache per connection. If left blank this defaults to a value reasonable for the database in use (currently only limited on Oracle to 30). Use 0 for unlimited PreparedStatements. Its default value is set at 0. The name of this setting in the App.config file is <psCacheMax>.
  • Test connection before use - 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. The name of this setting in the App.config file is <testOnAlloc>.
  • Test connection on exception - when this property is set to True then connections involved in an exception thrown by OpenAccess are validated before being returned to the pool. By default it is set to True. The name of this setting in the App.config file is <testOnException>.
  • Test connection 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. The name of this setting in the App.config file is <testOnRelease>.
  • Test connection 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. The name of this setting in the App.config file is <testWhenIdle>.
  • Wait for connection on startup - when this property is set to True then the OpenAccess will wait until it can successfully connect to the database before starting. If this is set to False (its default value) it will fail to start. This is useful in production to avoid timing issues with database startup and application deployment. The name of this setting in the App.config file is <waitForConOnStartup>.