Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

考虑复制延迟,在事务的时候,数据源可以强制主库吗? #13

Open
solaray opened this issue Aug 28, 2017 · 4 comments

Comments

@solaray
Copy link

solaray commented Aug 28, 2017

如果是事务,那么会希望也是从主库读取数据,
能强制一个事务(一个service方法)全都走主库吗?

@solaray
Copy link
Author

solaray commented Aug 28, 2017

我的意思是说一个service类里面有一个更改数据的service方法
这个方法有get、query、update组成
能强制get和query也是从主库读取么?

@chenlei2
Copy link
Owner

你在要强制周写库之前 添加ConnectionHold.FORCE_WRITE(ture)

@chenlei2
Copy link
Owner

chenlei2 commented May 6, 2018

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

@huyang168
Copy link

增加@transactional(isolation = Isolation.SERIALIZABLE) 事务直接报错了,CGLIB代理类不支持接口事务方式

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants