spring-boot-mybatis-rw icon indicating copy to clipboard operation
spring-boot-mybatis-rw copied to clipboard

ForceWrite怎么用呢?

Open syncml opened this issue 9 years ago • 2 comments
trafficstars

很好的插件,准备用到项目中,请问如果我要强制走主库,怎么操作?谢谢

syncml avatar Nov 20 '16 09:11 syncml

在每次执行 sql之前先执行 ConnectionHold.FORCE_WRITE.set(true);

chenlei2 avatar Nov 21 '16 09:11 chenlei2

最新版本:@transactional(isolation = Isolation.SERIALIZABLE) 强制本事务都走写库,插件会把事务隔离级别修改为默认隔离级别

chenlei2 avatar May 16 '18 01:05 chenlei2