use of com.baomidou.dynamic.datasource.exception.CannotFindDataSourceException in project dynamic-datasource-spring-boot-starter by baomidou.
the class DynamicRoutingDataSource method determinePrimaryDataSource.
private DataSource determinePrimaryDataSource() {
log.debug("dynamic-datasource switch to the primary datasource");
DataSource dataSource = dataSourceMap.get(primary);
if (dataSource != null) {
return dataSource;
}
GroupDataSource groupDataSource = groupDataSources.get(primary);
if (groupDataSource != null) {
return groupDataSource.determineDataSource();
}
throw new CannotFindDataSourceException("dynamic-datasource can not find primary datasource");
}
Aggregations