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

分表且复用PreparedStatement对象造成数据路由错误 #199

Closed
hanahmily opened this issue Nov 29, 2016 · 1 comment
Closed

分表且复用PreparedStatement对象造成数据路由错误 #199

hanahmily opened this issue Nov 29, 2016 · 1 comment

Comments

@hanahmily
Copy link
Contributor

分表场景下,复用PreparedStatement对象 或者 使用batch方法

问题复现步骤:

  1. 只分表
  2. 复用PreparedStatement
PreparedStatement ps = shardingConnection.prepareStatement(.....)
...
...
ps.execute();
...
...
ps.execute()
  1. 或使用batch接口
...
ps.addBatch();
...
...
ps.addBatch();
ps.executeBatch();

期望的表现:

数据像日志预期的那样插入到指定的表

观察到的表现:

数据全插入了第一次路由到的表,后续的表不插入

Sharding-JDBC版本: [1.4.0]
操作系统及版本: [OSX]

xydonne pushed a commit to xydonne/sharding-jdbc that referenced this issue Dec 2, 2016
@ben1247
Copy link

ben1247 commented Dec 26, 2016

赞一个~

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

2 participants