We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
同一个方法内同时有读写操作时 如果读操作在前 方法内的所有读写操作都会走从库 如果写操作在前 之后的所有读写操作都走主库
The text was updated successfully, but these errors were encountered:
经过测试发现不加事物的时候能正常拿到对应的ds,加入事物后按第一条sql条件取ds,代码如下 @transactional public Integer updateStatus(Integer orderId) { Order order = orderMapper.selectByOrderId(orderId); order.setStatus("UPDATE"); return orderMapper.updateByPrimaryKeySelective(order); } 不加事物的时候能更新主库记录,加上事物后只有从库记录被更新
Sorry, something went wrong.
这个问题,已经确认是bug了吗?影响应该蛮大的吧
@terrymanu, any update with such issue ?
这个本身是个bug,但是针对您的这种操作我建议使用HintManager的setMasterRouteOnly,将一些列操作都指向主库。这样才能保证dml操作会被即时查询到。 针对这个bug的修改为,第一次遇到dml操作后,会将之后的所有操作都保持在主库上。dml操作之前如果有dql操作,那么会从从库中进行操作。
1a20287
No branches or pull requests
同一个方法内同时有读写操作时 如果读操作在前 方法内的所有读写操作都会走从库 如果写操作在前 之后的所有读写操作都走主库
The text was updated successfully, but these errors were encountered: