This commit is contained in:
Looly 2024-01-18 17:14:58 +08:00
parent 207b7b1687
commit e33f9c82eb

View File

@ -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);