How to use Spring AbstractRoutingDataSource with dynamic datasources?

前端 未结 2 1864
情歌与酒
情歌与酒 2020-12-05 21:25

I am working in a project using Spring, Spring Data JPA, Spring Security, Primefaces...

I was following this tutorial about dynamic datasource routing with spring.

2条回答
  •  半阙折子戏
    2020-12-05 22:02

    The datasource used by a thread might change from time to time.
    Should pay attention to concurrency, applications might get concurrency issues in concurrent environment.
    thread-bound AbstractRoutingDataSource sample

提交回复
热议问题