Package org.springframework.dao

Examples of org.springframework.dao.NonTransientDataAccessResourceException


      }
      // fallback
      return new InvalidDataAccessResourceUsageException(ex.toString(), ex);
    }
    // unknown
    return new NonTransientDataAccessResourceException("Unknown exception", ex);
  }
View Full Code Here


      // 11 - parse error
    case 11:
      return new BadSqlGrammarException("Hive query", "", new SQLException(cause, sqlState));
      // 12 - Internal error
    case 12:
      return new NonTransientDataAccessResourceException(cause, ex);
      // -10000 - another internal error
    case -10000:
      return new NonTransientDataAccessResourceException(cause, ex);
    }

    // look at the SQL code

    if ("08S01".equals(sqlState)) {
      // internal error
      return new NonTransientDataAccessResourceException(cause, ex);
    }
    // generic syntax error
    else if ("42000".equals(sqlState)) {
      return new BadSqlGrammarException("Hive query", "", new SQLException(cause, sqlState));
    }
    // not found/already exists
    else if ("42S02".equals(sqlState)) {
      return new InvalidDataAccessResourceUsageException(cause, ex);
    }
    // invalid argument
    else if ("21000".equals(sqlState)) {
      return new BadSqlGrammarException("Hive query", "", new SQLException(cause, sqlState));
    }

    // use the new Hive 0.10 codes
    // https://issues.apache.org/jira/browse/HIVE-3001

    // semantic analysis
    if (err >= 10000 && err <= 19999) {
      return new InvalidDataAccessResourceUsageException(cause, ex);
    }
    // non transient runtime errors
    else if (err >= 20000 && err <= 29999) {
      return new DataRetrievalFailureException(cause, ex);

    }
    // transient error - should retry
    else if (err >= 30000 && err <= 39999) {
      return new TransientDataAccessResourceException(cause, ex);
    }
    // internal/unknown errors
    else if (err >= 40000 && err <= 49999) {
      return new NonTransientDataAccessResourceException(cause, ex);
    }

    // unknown error
    return new NonTransientDataAccessResourceException(cause, ex);
  }
View Full Code Here

      if (PARSER_EXCEPTION != null && PARSER_EXCEPTION.isAssignableFrom(ex.getClass())) {
        return new InvalidDataAccessResourceUsageException("Syntax error", ex);
      }
    }

    return new NonTransientDataAccessResourceException("Unknown Pig error", ex);
  }
View Full Code Here

    Throwable cause = ex.getCause();
    if (cause instanceof PigException) {
      return convert((PigException) ex);
    }

    return new NonTransientDataAccessResourceException("Unknown Pig error", ex);
  }
View Full Code Here

TOP

Related Classes of org.springframework.dao.NonTransientDataAccessResourceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.