Class TenantRoutingDataSource

All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, InitializingBean

public class TenantRoutingDataSource extends AbstractRoutingDataSource
Routes each new connection to the tenant's database: the tenant pinned on the thread by TenantScope first, then the ContextContainer tenant. The pin keeps background work on one tenant's database even when code it calls changes or clears the ContextContainer.