Solve the problem that spring MVC multi data source switching does not support transaction control
•
Java
A project needs to use two databases, Oracle and MYSQL, so refer to various blogs to realize this function. After writing, I found that the original transaction failed. I'll go
spring-mybatis. XML configuration
Annotation switching. Oracle data source is used by default
The annotation method can switch data sources, search annotations, replace the data sources above annotations, and support class annotations and method annotations
Inherit abstractroutingdatasource to realize data source switching
Using demo
The above article solves the problem of spring MVC multi data source switching and does not support transaction control, which is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码