code: protected UniversalIdIntQueueMessage _takeWithRetries(Connection conn, int numRetries,
              int maxRetries) {
          try {
              UniversalIdIntQueueMessage msg = null;
              long ephemeralId = QueueUtils.IDGEN.generateId64();
              int numRows = getJdbcHelper().execute(conn, SQL_UPDATE_EPHEMERAL_ID_TAKE, ephemeralId);
              if (numRows > 0) {
                  Map<String, Object> dbRow = getJdbcHelper().executeSelectOne(conn,
                          SQL_READ_BY_EPHEMERAL_ID, ephemeralId);
                  if (dbRow != null) {
                      msg = UniversalIdIntQueueMessage.newInstance(dbRow);
                  }
              }
              return msg;
          } catch (DaoException de) {
              if (de.getCause() instanceof ConcurrencyFailureException) {
                  if (numRetries > maxRetries) {
                      throw new QueueException(de);
                  } else {
                      incRetryCounter("_takeWithRetries");
                      return _takeWithRetries(conn, numRetries + 1, maxRetries);
                  }
              }
              throw de;
          } catch (Exception e) {
              throw e instanceof QueueException ? (QueueException) e : new QueueException(e);
          }
      }
docs: {@inheritDoc}