/**
   * Marks as deleted the entry with the given id
   *
   * @param id the entry id
   * @throws DataAccessException if an error occurs
   * @return the number of updated entries
   */
  public int markAsDeleted(long id) throws DataAccessException {

    Connection con = null;
    PreparedStatement ps = null;
    int rowsUpdated = 0;

    try {

      con = getConnection();

      ps = con.prepareStatement(queryDesc.getUpdateStatusQuery());

      ps.setLong(1, System.currentTimeMillis());
      ps.setString(2, RegistryEntryStatus.DELETED);
      ps.setLong(3, id);

      rowsUpdated = ps.executeUpdate();

    } catch (Exception ex) {

      throw new DataAccessException("Error marking entry with id '" + id + "' as deleted", ex);

    } finally {
      DBTools.close(con, ps, null);
    }
    return rowsUpdated;
  }