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

使用Anima.atomic连接池泄露 #49

Open
jungle817 opened this issue Apr 4, 2019 · 1 comment
Open

使用Anima.atomic连接池泄露 #49

jungle817 opened this issue Apr 4, 2019 · 1 comment

Comments

@jungle817
Copy link

jungle817 commented Apr 4, 2019

每使用Anima.atomic一次,就泄露一个连接,跟踪了一下代码,发现在AnimaQuery中,方法
private Connection getConn() {
Connection connection = localConnection.get();
return ifNotNullReturn(connection, connection, this.getSql2o().open());
}
ifNotNullReturn(connection, connection, this.getSql2o().open()); 这儿无论connection是否为空,都回去调用this.getSql2o().open()打开新的连接,我把这儿改成
if (connection!= null) {
return connection;
} else{
return this.getSql2o().open();
}
不知道我的理解是否正确

@belialofking
Copy link

+1

belialofking pushed a commit to belialofking/anima that referenced this issue Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants