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

DDL操作,链接获取后不会自动释放归还连接池。 #460

Closed
ljgGit opened this issue Nov 22, 2017 · 1 comment
Closed

DDL操作,链接获取后不会自动释放归还连接池。 #460

ljgGit opened this issue Nov 22, 2017 · 1 comment

Comments

@ljgGit
Copy link

ljgGit commented Nov 22, 2017

Please answer these questions before submitting your issue. Thanks!
第一次使用 , 求教 :

Which version of Sharding-Jdbc do you using?

1.5.4 1.5.4.1 ... 等 都有

Expected behavior

Actual behavior

Steps to reproduce the behavior

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

使用官方提供的jdbc用例,
private static void executeUpdate(final DataSource dataSource, final String sql) throws SQLException {
Connection conn = null;
PreparedStatement preparedStatement = null;
try {
conn = dataSource.getConnection();
preparedStatement = conn.prepareStatement(sql);
System.out.println(sql);
preparedStatement.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
} finally {
// DDL 操作不会释放 可能是分表时DDL操作 改写的问题。
System.out.println("----------------------");
preparedStatement.close();
conn.close();
}
}

场景: 仅分表 。
DML类型的SQL 可以正常释放 归还到连接池。
DDL类型的SQL 没有正常释放。

@terrymanu
Copy link
Member

duplicate with #452

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