DataJdbcSource优化
This commit is contained in:
@@ -2792,9 +2792,15 @@ public class DataJdbcSource extends AbstractDataSqlSource {
|
|||||||
this.queue = newQueue;
|
this.queue = newQueue;
|
||||||
this.maxConns = newMaxconns;
|
this.maxConns = newMaxconns;
|
||||||
this.canNewSemaphore = new Semaphore(this.maxConns);
|
this.canNewSemaphore = new Semaphore(this.maxConns);
|
||||||
Connection conn;
|
Connection c;
|
||||||
while ((conn = oldQueue.poll()) != null) {
|
while ((c = oldQueue.poll()) != null) {
|
||||||
offerConnection(conn, oldSemaphore);
|
try {
|
||||||
|
if (c.getClientInfo() != null) {
|
||||||
|
c.getClientInfo().put("version", "-1");
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
}
|
||||||
|
offerConnection(c, oldSemaphore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2830,6 +2836,12 @@ public class DataJdbcSource extends AbstractDataSqlSource {
|
|||||||
this.canNewSemaphore = new Semaphore(this.maxConns);
|
this.canNewSemaphore = new Semaphore(this.maxConns);
|
||||||
Connection c;
|
Connection c;
|
||||||
while ((c = oldQueue.poll()) != null) {
|
while ((c = oldQueue.poll()) != null) {
|
||||||
|
try {
|
||||||
|
if (c.getClientInfo() != null) {
|
||||||
|
c.getClientInfo().put("version", "-1");
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
}
|
||||||
offerConnection(c, oldSemaphore);
|
offerConnection(c, oldSemaphore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user