mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
1.系统计时器的时间(connectedTimeNano)记录到日志中不能准确的反映连接的时间(connectedTimeNano),换用(增加参数) connectedTimeMillis 记录获取连接的时间
2.处理 mysql 8 小时超时问题(即使testWhileIdle=false,testOnBorrow=false,testOnReturn=false),在物理连接的已连接时间超过 phyTimeoutMillis(默认7小时) 后就自动关闭该物理连接 3.修正单词拼写 destoryTask -> destroyTask
This commit is contained in:
@@ -65,7 +65,7 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
|
||||
private boolean disable = false;
|
||||
private boolean closed = false;
|
||||
private final Thread ownerThread;
|
||||
|
||||
private long connectedTimeMillis;
|
||||
private long connectedTimeNano;
|
||||
private volatile boolean running = false;
|
||||
|
||||
@@ -82,6 +82,11 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
|
||||
this.holder = holder;
|
||||
dupCloseLogEnable = holder.getDataSource().isDupCloseLogEnable();
|
||||
ownerThread = Thread.currentThread();
|
||||
connectedTimeMillis = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public long getConnectedTimeMillis() {
|
||||
return connectedTimeMillis;
|
||||
}
|
||||
|
||||
public Thread getOwnerThread() {
|
||||
|
||||
Reference in New Issue
Block a user