IN PROGRESS - issue DRUID-80: 优化PreparedStatementCache的LRU算法

http://code.alibabatech.com/jira/browse/DRUID-80
This commit is contained in:
wenshao
2011-11-07 14:58:31 +08:00
parent 7711945dcc
commit 72c0d1c7b5
@@ -43,7 +43,7 @@ public class PreparedStatementPool {
}
public PreparedStatementHolder get(PreparedStatementKey key) {
PreparedStatementHolder holder = map.remove(key);
PreparedStatementHolder holder = map.get(key);
if (holder != null) {
holder.incrementReusedCount();
@@ -73,7 +73,7 @@ public class PreparedStatementPool {
private static final long serialVersionUID = 1L;
public LRUCache(int maxSize){
super(maxSize);
super(maxSize, 0.75f, true);
}
protected boolean removeEldestEntry(Entry<PreparedStatementKey, PreparedStatementHolder> eldest) {