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

Support transaction isolation on JDBC #629

Closed
ztgoto opened this issue Mar 5, 2018 · 4 comments
Closed

Support transaction isolation on JDBC #629

ztgoto opened this issue Mar 5, 2018 · 4 comments

Comments

@ztgoto
Copy link

ztgoto commented Mar 5, 2018

version: 2.0.3
发现在sharding-jdbc拿到的连接 取到的事务隔离级别都是 1
但我们的mysql的事务隔离级别是4(REPEATABLE_READ)
那这种情况在与spring集成时是否得明确指定事务隔离级别,否则是没办法取到mysql设置的隔离级别的?

@terrymanu
Copy link
Member

通过jdbc可以获取事务隔离级别么,如果可以,可以试试sharding jdbc能否取到?

@ztgoto
Copy link
Author

ztgoto commented Mar 6, 2018

druid数据源和jdbc都是可以的,我们尝试修改了数据库的全局事务隔离级别,在druid或jdbc上都能正确反映出来。
而sharding-jdbc不行,主要原因来至于sharding-jdbc中AbstractConnectionAdapter transactionIsolation使用的是TRANSACTION_READ_UNCOMMITTED,在并未手动设置sharding-jdbc连接时的事务隔离级别情况下 取到的就是TRANSACTION_READ_UNCOMMITTED 这个默认值,并非为数据库中设置的事务隔离级别

@terrymanu
Copy link
Member

terrymanu commented Mar 6, 2018

ok, this is a enhancement. we will do it on next release.
Or you can give us a pull request if you want.

@terrymanu
Copy link
Member

fixed at 3.0.0.M1

@terrymanu terrymanu changed the title 关于事务隔离级别 Support transaction isolation on JDBC Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants