* This releases the resources used for a database.
* Is called with id 0 multiple times for non-existent databases
*/
final synchronized void releaseDatabase(int id) {
Iterator it;
boolean found = false;
printWithThread("releaseDatabase(" + id + ") entered");
// check all slots as a database may be opened by multiple aliases
for (int i = 0; i < dbID.length; i++) {
if (dbID[i] == id && dbAlias[i] != null) {
dbID[i] = 0;
dbActionSequence[i] = 0;
dbAlias[i] = null;
dbPath[i] = null;
dbType[i] = null;
dbProps[i] = null;
}
}
synchronized (serverConnSet) {
it = new WrapperIterator(serverConnSet.toArray(null));
}
while (it.hasNext()) {
ServerConnection sc = (ServerConnection) it.next();
if (sc.dbID == id) {
sc.signalClose();
serverConnSet.remove(sc);
}