if (!(plainLock instanceof RecordHandle)) {
// only interested in rows locks
continue;
}
ContainerKey ckey = ((RecordHandle) plainLock).getContainerId();
LockCount lc = (LockCount) containers.get(ckey);
if (lc == null) {
lc = new LockCount();
containers.put(ckey, lc);
}
lc.count++;
}
// Determine the threshold for lock escalation
// based upon our own limit, not the current count
int threshold = limit / (containers.size() + 1);
if (threshold < (limit / 4))
threshold = limit / 4;
// try to table lock all tables that are above
// this threshold
boolean didEscalate = false;
for (Enumeration e = containers.keys(); e.hasMoreElements(); ) {
ContainerKey ckey = (ContainerKey) e.nextElement();
LockCount lc = (LockCount) containers.get(ckey);
if (lc.count < threshold) {
continue;