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

无法插入其他自增主键的表,从1.4.2升级到1.5.3出现的bug #370

Closed
pptom opened this issue Sep 11, 2017 · 2 comments
Closed

Comments

@pptom
Copy link

pptom commented Sep 11, 2017

Please answer these questions before submitting your issue. Thanks!

Which version of Sharding-Jdbc do you using?

1.5.3

Expected behavior

自增主键的表应该能正常插入,现在不能正常插入。

Actual behavior

抛出异常:详情看demo
java.sql.SQLException: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate(), Statement.executeLargeUpdate() or Connection.prepareStatement().

Steps to reproduce the behavior

重现步骤
1.执行demo中的sql文件建表
2.配置application.properties中的数据库连接信息
3.运行DemoSjApplication类里的主函数
3.打开 http://localhost:8080/ 返回json串则正常添加,否则出现上述所说的异常。。
/*
pom文件里注释1.5.3 的引入,切换为 1.4.2则可正常返回
根据tangmin721 所说的,我测试了下,1.5.2是正常的,1.5.3就不行了。
*/

Please provide the reproduce example codes (such as github link) if possible.

demo地址:https://github.com/pptom/demo-sj

@tangmin721
Copy link

1.5.2也能,到1.5.3就不行了

terrymanu added a commit that referenced this issue Sep 12, 2017
@terrymanu
Copy link
Member

fixed at 1.5.4

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