if(log.isDebugEnabled()) { log.debug("Substitutions: " + substitutions); }
    private void cleanTrial(String cmtType, String hnaType, String csmiType, String oldTrialId)        throws SQLException    {        substitutions.put(":trial_id:", oldTrialId);        substitutions.put(":cmt_type:", cmtType);        substitutions.put(":hna_type:", hnaType);        substitutions.put(":csmi_type:", csmiType);        ResultSet rs =            executeQuery(stmt, dbp.getQuery("queryAssembliesToClean", substitutions));        if (rs.next()) {            boolean first = true;            StringBuffer assembliesToDelete = new StringBuffer();            assembliesToDelete.append("(");            do {                if (first) {                    first = false;                } else {                    assembliesToDelete.append(", ");                }                assembliesToDelete.append(sqlQuote(rs.getString(1)));            } while (rs.next());            assembliesToDelete.append(")");            substitutions.put(":assemblies_to_clean:", assembliesToDelete.toString());            executeUpdate(dbp.getQuery("cleanTrialAssembly", substitutions));        }        rs.close();        executeUpdate(dbp.getQuery("cleanTrialRecipe", substitutions));    }