This commit is contained in:
wenshao
2014-06-01 19:16:20 +08:00
23 changed files with 478 additions and 73 deletions
@@ -149,6 +149,8 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
public static ThreadLocal<Long> waitNanosLocal = new ThreadLocal<Long>();
private boolean logDiffrentThread = true;
public DruidDataSource(){
this(false);
}
@@ -1128,7 +1130,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
return;
}
if (pooledConnection.getOwnerThread() != Thread.currentThread()) {
if (logDiffrentThread && pooledConnection.getOwnerThread() != Thread.currentThread()) {
LOG.warn("get/close not same thread");
}
@@ -1569,6 +1571,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
value.setTestWhileIdle(this.isTestWhileIdle());
value.setDefaultAutoCommit(this.isDefaultAutoCommit());
if (defaultReadOnly != null) {
value.setDefaultReadOnly(defaultReadOnly);
}
@@ -2395,4 +2398,12 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
return super.unwrap(iface);
}
public boolean isLogDiffrentThread() {
return logDiffrentThread;
}
public void setLogDiffrentThread(boolean logDiffrentThread) {
this.logDiffrentThread = logDiffrentThread;
}
}