mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix code
This commit is contained in:
parent
207b7b1687
commit
e33f9c82eb
@ -279,6 +279,21 @@ public class Session extends AbstractDb<Session> implements Closeable {
|
||||
|
||||
// ---------------------------------------------------------------------------- Transaction method end
|
||||
|
||||
@Override
|
||||
public void closeConnection(final Connection conn) {
|
||||
try {
|
||||
if(conn != null && false == conn.getAutoCommit()) {
|
||||
// 事务中的Session忽略关闭事件
|
||||
return;
|
||||
}
|
||||
} catch (final SQLException e) {
|
||||
log.error(e);
|
||||
}
|
||||
|
||||
// 普通请求关闭(或归还)连接
|
||||
ThreadLocalConnection.INSTANCE.close(this.ds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
closeConnection(null);
|
||||
|
Loading…
x
Reference in New Issue
Block a user