code: private boolean isRetryException(final Throwable th) {
          Throwable current = th;
          boolean res = false;
          while (current != null) {
              if (current instanceof ONeedRetryException) {
                  res = true;
                  break;
              }
              current = current.getCause();
          }
          return res;
      }
docs: Searching for {@link com.orientechnologies.common.concur.ONeedRetryException} in exception hierarchy.
  
  @param th thrown exception
  @return true if retry could be performed