Table of Contents

TTenantPoolProvider Class

Resolves a tenant to the connection pool of its shard: catalog routing (cached), status check, shard pool.

Remarks

On every call to GetPool the tenant is read from the Cache, its status and the status of its shard are checked, and the pool is taken from ShardPools. Because statuses are enforced on every call, a suspended tenant is blocked as soon as its cache entry is refreshed or invalidated, even with warm pools. A shard that the catalog does not track is treated as active. Implements ITenantDBPoolProvider, so it can be used wherever that interface is expected, including TTenantRoutingConnectionPool.

Syntax

Unit: Aurelius.Tenancy.Provider

TTenantPoolProvider = class(TInterfacedObject, ITenantDBPoolProvider);

Constructors

Methods

Name Description
GetPool Returns the connection pool of the shard that hosts the given tenant.
InvalidateAll Drops all cached routing information and all shard pools.
InvalidateShard Drops the cached information and the connection pool of a shard, forcing the pool to be rebuilt on next use.
InvalidateTenant Drops the cached routing information of a tenant, so the next request re-reads the catalog.

Properties

Name Description
Cache The routing cache the provider reads tenant and shard information from.
ShardPools The provider of shard connection pools.