cache connection

This commit is contained in:
SwallowGG
2024-05-16 00:00:11 +08:00
parent 0cec8f2dc8
commit 91e384f5dd
2 changed files with 2 additions and 0 deletions

View File

@ -556,6 +556,7 @@ public class ConnectInfo {
copy.setDriverConfig(this.getDriverConfig());
copy.setSid(this.getSid());
copy.setUrlWithOutDatabase(this.getUrlWithOutDatabase());
copy.setLastAccessTime(new Date());
return copy;
}

View File

@ -120,6 +120,7 @@ public class ConnectionPool {
synchronized (lock) {
int n = lock.decrementRefCount();
if (n == 0) {
lock.setLastAccessTime(new Date());
lock.setConnection(connectInfo.getConnection());
} else {
connectInfo.close();