dotConnect for PostgreSQL Documentation
KeepConnected Property
See Also
Devart.Data.PostgreSql Namespace > PgSqlConnectionStringBuilder Class : KeepConnected Property

Specifies whether to perform periodic ping calls to PostgreSQL when a connection is inactive (in order to avoid PostgreSQL closing connection because of inactivity and to always know if the connection is still valid) and the interval at which the calls are made in seconds. Default value is 0, which means that the calls are not made.


Visual Basic (Declaration) 
Public Property KeepConnected As Integer
public int KeepConnected {get; set;}

Property Value

The interval at which ping reauests are sent in seconds.


You can use this connection parameter in order to keep an idle connection for a prolonged period of time and be sure that it was not broken. Just specify a non-zero interval in seonds in this parameter, and the connection will perform periodic ping calls to PostgreSQL. If such call fails, the StateChange event occurs.

We recommend to use this parameter only when it is necessary to keep idle connection alive for long periods of time. We do not recommend using it when it's not needed.


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