public void purgeAlerts(long endDate){
  Connection conn=null;
  PreparedStatement stmt=null;
  String sql="delete from ALERT where ts<=?";
  logger.log(Level.INFO,"To purge alerts up to " + endDate);
  try {
    conn=createConnection(true);
    stmt=conn.prepareStatement(sql);
    stmt.setLong(1,endDate);
    stmt.execute();
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"Failed to purge alerts up to " + endDate,ex);
    try {
      conn.rollback();
    }
 catch (    Exception iex) {
    }
  }
 finally {
    DBUtils.close(stmt);
    DBUtils.close(conn);
  }
}

public void purgeAlerts ( long endDate ) { Connection conn = null ; PreparedStatement stmt = null ; String sql = "delete from ALERT where ts<=?" ; logger . log ( Level . INFO , "To purge alerts up to " + endDate ) ; try { conn = createConnection ( true ) ; stmt = conn . prepareStatement ( sql ) ; stmt . setLong ( 1 , endDate ) ; stmt . execute ( ) ; } catch ( Exception ex ) { logger . log ( Level . SEVERE , "Failed to purge alerts up to " + endDate , ex ) ; try { conn . rollback ( ) ; } catch ( Exception iex ) { } } finally { DBUtils . close ( stmt ) ; DBUtils . close ( conn ) ; } }
remove all old alerts exceeded retention threshold
