if (log.isTraceEnabled()) { log.trace("Enabling transacted messages for " + channelID); }
   public void enableTransactedMessages(Serializable channelID, Serializable txID)         throws SystemException   {      try      {         if (log.isTraceEnabled()) { log.trace("Current transaction: " + currentTransactionToString()); }         Connection conn = ds.getConnection();         Statement stat = conn.createStatement();         String sql = "SELECT MESSAGEID, STOREID FROM TRANSACTIONAL_MESSAGE_REFERENCES WHERE " +                      "CHANNELID = '" + channelID + "' AND " +                      "TXID = '" + txID + "'";         ResultSet rs = stat.executeQuery(sql);         if (log.isTraceEnabled()) { log.trace(sql); }         while (rs.next())         {            sql = "INSERT INTO MESSAGE_REFERENCES VALUES ('" +                  channelID + "', '" +                  rs.getString("MESSAGEID") + "', '" +                  rs.getString("STOREID") + "')";            stat.executeUpdate(sql);            if (log.isTraceEnabled()) { log.trace(sql); }         }         sql = "DELETE FROM TRANSACTIONAL_MESSAGE_REFERENCES WHERE " +               "CHANNELID = '" + channelID + "' AND " +               "TXID = '" + txID + "'";         stat.executeUpdate(sql);         if (log.isTraceEnabled()) { log.trace(sql); }         conn.close();      }      catch(Throwable t)      {         log.error("Failed to enable transacted undelivered", t);         tm.setRollbackOnly();      }   }