dotConnect for PostgreSQL Documentation
Devart.Data.PostgreSql Namespace / PgSqlConnectionStringBuilder Class / KeepConnected Property

In This Topic
    KeepConnected Property
    In This Topic
    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.
    Syntax
    'Declaration
     
    Public Property KeepConnected As Integer
    public int KeepConnected {get; set;}

    Property Value

    The interval at which ping reauests are sent in seconds.
    Remarks

    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.

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also