dotConnect for PostgreSQL Documentation
ValidateConnection Property
See Also  support@devart.com
Devart.Data.PostgreSql Namespace > PgSqlConnectionStringBuilder Class : ValidateConnection Property

Indicates whether to validate connections that are being taken from the pool.

Syntax

Visual Basic (Declaration) 
Public Property ValidateConnection As Boolean
C# 
public bool ValidateConnection {get; set;}

Property Value

true, if the connection should be validated when it is taken from the pool; false otherwise.

Remarks

If true, each time when a connection is taken from the pool, it is checked for validity. If the connection is not valid, it is destroyed and a new one is created.

If this parameter is true, the connection pool manager background validation is disabled in this case as it is not needed. In such case we always have a valid connection, however the performance is not optimal.

This behaviour may be useful when the physical connection is unstable and connection can be lost in a short period of time. Pool manager validates pool connections every 30 seconds, so it is possible that connection will become invalid during this interval and the application will take it from the pool before the validation. If the physical connection is stable, pool manager validation is enough to ensure that the connection is valid, so it is better not to use this property. Use this property only if necessary because it causes a round-trip to the database to validate each connection immediately before it is provided to the application.

Requirements

Platforms:Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8, Windows 10, Windows Server 2012 family.

See Also