657658659660661662663664665666667
// locks is modified in the loop for (int i = 0; i < locks.size(); i++) { Table t = locks.get(i); if (!t.isLockedExclusively()) { synchronized (database) { t.unlock(this); locks.remove(i); } i--; } }
685686687688689690691692693694695
if (locks.size() > 0) { synchronized (database) { // don't use the enhanced for loop to save memory for (int i = 0, size = locks.size(); i < size; i++) { Table t = locks.get(i); t.unlock(this); } locks.clear(); } } savepoints = null;