anima icon indicating copy to clipboard operation
anima copied to clipboard

使用Anima.atomic连接池泄露

Open jungle817 opened this issue 5 years ago • 1 comments

每使用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(); } 不知道我的理解是否正确

jungle817 avatar Apr 04 '19 01:04 jungle817

+1

belialofking avatar Nov 14 '19 05:11 belialofking