core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLAbstract.java
protected boolean parseTimeout(final String w) throws OCommandSQLParsingException {
    if (!w.equals(KEYWORD_TIMEOUT))
      return false;

    String word = parserNextWord(true);

    try {
      timeoutMs = Long.parseLong(word);
    } catch (NumberFormatException ignore) {
      throwParsingException("Invalid " + KEYWORD_TIMEOUT + " value set to '" + word + "' but it should be a valid long. Example: "
          + KEYWORD_TIMEOUT + " 3000");
    }

    if (timeoutMs < 0)
      throwParsingException("Invalid " + KEYWORD_TIMEOUT + ": value set minor than ZERO. Example: " + KEYWORD_TIMEOUT + " 10000");

    word = parserNextWord(true);

    if (word != null)
      if (word.equals(TIMEOUT_STRATEGY.EXCEPTION.toString()))
        timeoutStrategy = TIMEOUT_STRATEGY.EXCEPTION;
      else if (word.equals(TIMEOUT_STRATEGY.RETURN.toString()))
        timeoutStrategy = TIMEOUT_STRATEGY.RETURN;
      else
        parserGoBack();

    return true;
  }
protected boolean parseTimeout(final String w) throws OCommandSQLParsingException {
    if (!w.equals(KEYWORD_TIMEOUT))
      return false;

    String word = parserNextWord(true);

    try {
      timeoutMs = Long.parseLong(word);
    } catch (NumberFormatException ignore) {
      throwParsingException("Invalid " + KEYWORD_TIMEOUT + " value set to '" + word + "' but it should be a valid long. Example: "
          + KEYWORD_TIMEOUT + " 3000");
    }

    if (timeoutMs < 0)
      throwParsingException("Invalid " + KEYWORD_TIMEOUT + ": value set minor than ZERO. Example: " + KEYWORD_TIMEOUT + " 10000");

    word = parserNextWord(true);

    if (word != null)
      if (word.equals(TIMEOUT_STRATEGY.EXCEPTION.toString()))
        timeoutStrategy = TIMEOUT_STRATEGY.EXCEPTION;
      else if (word.equals(TIMEOUT_STRATEGY.RETURN.toString()))
        timeoutStrategy = TIMEOUT_STRATEGY.RETURN;
      else
        parserGoBack();

    return true;
  }
Parses the timeout keyword if found.