bug fixed for multi-thread use one connection.

This commit is contained in:
shaojin.wensj
2019-03-20 15:27:33 +08:00
parent ac47967a16
commit 116e7bee1a
3 changed files with 33 additions and 9 deletions
@@ -69,13 +69,14 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
private volatile boolean abandoned = false;
protected StackTraceElement[] connectStackTrace;
protected Throwable disableError = null;
public ReentrantLock lock = new ReentrantLock();
final ReentrantLock lock;
public DruidPooledConnection(DruidConnectionHolder holder){
super(holder.getConnection());
this.conn = holder.getConnection();
this.holder = holder;
this.lock = holder.lock;
dupCloseLogEnable = holder.getDataSource().isDupCloseLogEnable();
ownerThread = Thread.currentThread();
connectedTimeMillis = System.currentTimeMillis();