dotConnect for PostgreSQL Documentation
Devart.Data.PostgreSql Namespace / TargetSession Enumeration

In This Topic
    TargetSession Enumeration
    In This Topic
    Determines how the host to connect to is selected from the list when multiple hosts are specified in the Host connection string parameter. See Load Balancing and Failover for more information.
    Syntax
    'Declaration
     
    Public Enum TargetSession 
       Inherits System.Enum
       Implements System.IComparableSystem.IConvertibleSystem.IFormattable 
    Members
    MemberDescription
    AnyWhen opening a connection, dotConnect for PostgreSQL connects to any working host from the list and returns an error only if it could not connect to all of the hosts. After connecting, hosts are switched for read-only commands using round-robin load balancing. This option is the best for cases when load balancing is not configured on the server side, but there are several servers, running replicas of the same database and not divided into standby and primary, and the user wants their order to determine their function.
    PreferPrimaryWhen opening a connection, dotConnect for PostgreSQL looks for a primary host in the list. If a connection fails when executing a command and no valid primary host is found when reexecuting it via failover, any valid host from the list is selected, and a standby host can be selected too. After a standby host is selected, standby hosts are switched for read-only commands using round-robin load balancing.
    PreferStandbyWhen opening a connection, dotConnect for PostgreSQL connects to any working standby host from the list. If there are no valid standby hosts in the list, an error occurs. After connecting, standby hosts are switched for read-only commands using round-robin load balancing. If a connection fails when executing a command and no valid standby hosts are found when reexecuting it via failover, any valid host from the list is selected, and a primary host can be selected too.
    PrimaryWhen opening a connection, dotConnect for PostgreSQL looks for a primary host in the list. If there are no such host in the list, an error occurs.
    StandbyWhen opening a connection, dotConnect for PostgreSQL connects to any working standby host from the list. If there are no valid standby hosts in the list, an error occurs. After connecting, standby hosts are switched for any commands using round-robin load balancing.
    SuppressLoadBalancingDefault behaviour. dotConnect for PostgreSQL connects only to the first host in the list. It throws an exception and does not attempt to connect to other hosts if the first host is unavailable.
    Inheritance Hierarchy

    System.Object
       System.ValueType
          System.Enum
             Devart.Data.PostgreSql.TargetSession

    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