Skip to main content

ConnectionPoolOptions

  • Namespace: PPDS.Dataverse.Pooling
  • Assembly: PPDS.Dataverse
  • Kind: Class

Summary

Configuration options for the Dataverse connection pool.

Members

Properties

AcquireTimeout

TimeSpan AcquireTimeout { get; set; }

Gets or sets the maximum time to wait for a connection. With proper pool-managed concurrency, tasks queue on the semaphore and this timeout should rarely be hit. Set high enough to accommodate large imports with many batches queuing for connections. Default: 120 seconds

DisableAffinityCookie

bool DisableAffinityCookie { get; set; }

Gets or sets a value indicating whether to disable the affinity cookie for load distribution. Default: true (disabled)

EnableValidation

bool EnableValidation { get; set; }

Gets or sets a value indicating whether background connection validation is enabled. Default: true

Enabled

bool Enabled { get; set; }

Gets or sets a value indicating whether connection pooling is enabled. Default: true

MaxConnectionRetries

int MaxConnectionRetries { get; set; }

Gets or sets the maximum number of retry attempts for auth/connection failures. When a connection fails due to auth or connectivity issues, operations will retry with a new connection up to this many times. Default: 2

MaxIdleTime

TimeSpan MaxIdleTime { get; set; }

Gets or sets the maximum connection idle time before eviction. Default: 5 minutes

MaxLifetime

TimeSpan MaxLifetime { get; set; }

Gets or sets the maximum connection lifetime. Set within OAuth token validity window for stable long-running scenarios. Default: 60 minutes

MaxPoolSize

int MaxPoolSize { get; set; }

Gets or sets a fixed total pool size override. When 0 (default), uses 52 × connection count (Microsoft's per-user limit). Set to a positive value to enforce a specific total pool size. Default: 0 (use per-connection sizing at 52 per user).

MaxRetryAfterTolerance

Nullable<TimeSpan> MaxRetryAfterTolerance { get; set; }

Gets or sets the maximum acceptable Retry-After duration before failing. Default: null (wait indefinitely for throttle to clear). If set, throws PPDS.Dataverse.Resilience.ServiceProtectionException when all connections are throttled and the shortest wait exceeds this value.

SelectionStrategy

ConnectionSelectionStrategy SelectionStrategy { get; set; }

Gets or sets the connection selection strategy. Default: ThrottleAware

ValidateOnCheckout

bool ValidateOnCheckout { get; set; }

Gets or sets a value indicating whether to validate connection health on checkout. When true, connections are checked for IsReady, age, and validity before being returned. Default: true

ValidationInterval

TimeSpan ValidationInterval { get; set; }

Gets or sets the interval for background validation. Default: 1 minute