Hi,

I've read all articles regarding multitenant applications in Spring. If I create a subclass of AbstractRoutingDataSource and in constructor I initialize all datasources and targetDataSources are initialized (multitenancy works).
But when new datasource is registered targetDataSources are allready initialized and it can not be accessed as in time when targetDataSources were initialized it didn't exists jet.

If application is restarted the datasource is included.

How is this solved? Thanks for any hints.