log.info("Removing all non-reliable message references");
log.debug("Removing all non-reliable message references");
   protected void resetMessageData() throws Exception   {      if (trace) { log.trace("Removing all non-persistent data"); }            Connection conn = null;      PreparedStatement ps = null;      TransactionWrapper wrap = new TransactionWrapper();            log.trace("Resetting message data. This may take several minutes for large queues/subscriptions...");            try      {         conn = ds.getConnection();                  log.info("Removing all non-reliable message references");                  ps = conn.prepareStatement(removeAllNonReliableRefs);                  int rows = ps.executeUpdate();                  if (trace)         {            log.trace(JDBCUtil.statementToString(removeAllNonReliableRefs)                  + " removed " + rows + " rows");         }                  ps.close();                  ps = null;                   ps = conn.prepareStatement(removeAllNonReliableMessages);                  rows = ps.executeUpdate();                  if (trace)         {            log.trace(JDBCUtil.statementToString(removeAllNonReliableMessages)                  + " removed " + rows + " rows");         }                  ps.close();                  ps = null;                  log.info("Updating all reliable references to not loaded");                           ps = conn.prepareStatement(updateAllReliableRefs);                  rows = ps.executeUpdate();                  if (trace)         {            log.trace(JDBCUtil.statementToString(updateAllReliableRefs)                  + " updated " + rows + " rows");         }                        ps.close();                  ps = null;                            if (deleteSubs)         {                        ps = conn.prepareStatement(deleteNonDurableSubs);                        rows = ps.executeUpdate();                        if (trace)            {               log.trace(JDBCUtil.statementToString(deleteNonDurableSubs)                     + " deleted " + rows + " rows");            }                   }      }      catch (Exception e)      {         wrap.exceptionOccurred();         throw e;      }      finally      {         if (ps != null)         {            try            {               ps.close();            }            catch (Throwable e)            {            }         }         if (conn != null)         {            try            {               conn.close();            }            catch (Throwable e)            {            }         }         wrap.end();      }   }