mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
修正testWhileIdle的行为
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@508 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -51,12 +51,18 @@ public class MockDriver implements Driver {
|
||||
private final AtomicLong connectCount = new AtomicLong();
|
||||
private final AtomicLong connectionCloseCount = new AtomicLong();
|
||||
|
||||
private final AtomicLong connectionIdSeed = new AtomicLong(1000L);
|
||||
|
||||
private final List<MockConnection> connections = new CopyOnWriteArrayList<MockConnection>();
|
||||
|
||||
static {
|
||||
registerDriver(instance);
|
||||
}
|
||||
|
||||
public long generateConnectionId() {
|
||||
return connectionIdSeed.incrementAndGet();
|
||||
}
|
||||
|
||||
public List<MockConnection> getConnections() {
|
||||
return connections;
|
||||
}
|
||||
@@ -75,7 +81,7 @@ public class MockDriver implements Driver {
|
||||
connections.remove(conn);
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("close");
|
||||
LOG.debug("conn-" + conn.getId() + " close");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +189,7 @@ public class MockDriver implements Driver {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("executeQuery " + sql);
|
||||
}
|
||||
|
||||
|
||||
MockConnection conn = stmt.getMockConnection();
|
||||
|
||||
if (conn != null) {
|
||||
|
||||
Reference in New Issue
Block a user