Use AbstractRoutingDataSource to dynamicly switch datasources, see http://spring.io/blog/2007/01/23/dynamic-datasource-routing.
PS: note the use of ThreadLocal; may conflict with the use of SqlSessionTemplate.
Use AbstractRoutingDataSource to dynamicly switch datasources, see http://spring.io/blog/2007/01/23/dynamic-datasource-routing.
Spring Dynamic DataSource Routing
原文:https://www.cnblogs.com/huangzejun/p/8143837.html