mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user