code: public synchronized boolean markFailed(int id) {
          boolean isSuccessful = false;
  
          SQLiteDatabase db = null;
          Cursor cursor = null;
          try {
              db = getWritableDatabase();
  
              // Get number of times this record has already failed to process.
              cursor = db.query(ShareRequestTable.NAME, new String[]{ShareRequestTable.COLUMN_FAILS},
                      WHERE_CLAUSE_BY_ID, new String[]{String.valueOf(id)}, null, null, null);
              if (cursor != null && cursor.moveToFirst()) {
                  int fails = cursor.getInt(cursor.getColumnIndex(ShareRequestTable.COLUMN_FAILS));
  
                  // Reset state back to pending and increment fails.
                  ContentValues values = new ContentValues();
                  values.put(ShareRequestTable.COLUMN_STATE, ShareRequest.STATE_PENDING);
                  values.put(ShareRequestTable.COLUMN_FAILS, fails + 1);
  
                  isSuccessful = db.update(ShareRequestTable.NAME, values, WHERE_CLAUSE_BY_ID,
                          new String[]{String.valueOf(id)}) > 0;
  
                  sLogger.log(WingsDbHelper.class, "markFailed", "isSuccessful=" + isSuccessful + " id=" + id);
              }
          } catch (SQLException e) {
              // Do nothing.
          } finally {
              if (cursor != null) {
                  cursor.close();
              }
              db.close();
          }
  
          return isSuccessful;
      }
docs: Marks a {@link ShareRequest} as failed to process.
  
  @param id the id of the {@link ShareRequest}.
  @return true if successful; false otherwise.