| | |
| | | { |
| | | DynamicDataSourceContextHolder.setDataSourceType(newDataSourceType); |
| | | isNewDataSource = true; |
| | | logger.debug("切换数据源: {} -> {}", oldDataSourceType, newDataSourceType); |
| | | //logger.debug("切换数据源: {} -> {}", oldDataSourceType, newDataSourceType); |
| | | } |
| | | } |
| | | |
| | |
| | | if (StringUtils.isNotEmpty(oldDataSourceType)) |
| | | { |
| | | DynamicDataSourceContextHolder.setDataSourceType(oldDataSourceType); |
| | | logger.debug("恢复数据源: {}", oldDataSourceType); |
| | | //logger.debug("恢复数据源: {}", oldDataSourceType); |
| | | } |
| | | else |
| | | { |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | logger.debug("清除数据源,恢复到默认数据源"); |
| | | //logger.debug("清除数据源,恢复到默认数据源"); |
| | | } |
| | | } |
| | | } |