} continue; } if (assid.startsWith(REAL_CMT_TYPE) || assid.startsWith(CSATYPE)) { if (log.isInfoEnabled()) { log.info("rmOrphanNonSoc got a CMT or CSA: " + assid);
  public void removeOrphanNonSocietyAssemblies() throws SQLException {    // Do a query for assemblyIDs in asb_assembly, where it is not    // of type cmtType or csaType    substitutions.put(":cmt_type:", REAL_CMT_TYPE);    substitutions.put(":csa_type:", CSATYPE);    substitutions.put(":trial_id:", "");    Statement stmt = getStatement();    ResultSet rs = executeQuery(stmt, dbp.getQuery("queryNonSocietyAssemblies", substitutions));    String assid = null;    // This loop is over _all_ CSMI and CSHNA assemblies    while (rs.next()) {      assid = rs.getString(1);      // So be sure to avoid ours      // FIXME: Does this really do that?      // FIXME: Maybe skip comm type assemblies altogether?      // Do that if this might get called while have a new expt      // that has not been saved, cause then comm info only in DB      if (assid == null || assid.equals(csmiAssemblyId) || assid.equals(hnaAssemblyId) || assid.equals(commAssemblyId)) {	if (log.isDebugEnabled()) {	  log.debug("removeOrphan not touching asb used in current trial (" + trialId + ": " + assid);	}	continue;      }      if (assemblyInRuntime(assid)) {	if (log.isDebugEnabled()) {	  log.debug("removeOrphan found asb in runtime for trial " + trialId + " not in local var: will skip: " + assid);	}	continue;      }       if (assemblyInConfig(assid)) {	if (log.isDebugEnabled()) {	  log.debug("removeOrphan found asb in configtime for trial " + trialId + " not in local var: will skip: " + assid);	}	continue;      }      // FIXME: Will this delete community assembly when I dont want to?      // I think this is only called by fixAssemblies,      // so as long as that sets up the commID in tables / var      // stuff OK, this is OK.      // for each such assembly      // FIXME: This will not delete a CSHNA or CSMI assembly that in the DB      // is associated with this Trial, but whose assId we don't have      // stashed away. Could this be an old one worth removing?      if (! isAssemblyUsed(assid)) 	cleanAssembly(assid);    }    rs.close();    stmt.close();  }