Package org.springframework.dao

Examples of org.springframework.dao.InvalidDataAccessResourceUsageException


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


    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);
View Full Code Here

    if (ex instanceof BackendException) {
      return new DataAccessResourceFailureException("Backend Pig exception", ex);
    }

    if (ex instanceof VisitorException || ex instanceof PlanException || ex instanceof SchemaMergeException) {
      return new InvalidDataAccessResourceUsageException("Plan failed", ex);
    }

    if (ex instanceof FrontendException) {
      if (ex.getClass().getName().contains("JobCreationException")) {
        return new InvalidDataAccessResourceUsageException("Map Reduce error", ex);
      }

      // work-around to let compilation on CDH3
      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

    if (ex instanceof CancellationException) {
      throw new OperationCancellationException(ex.getMessage(), ex);
    }

    if (ex instanceof InvalidViewException) {
      throw new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
    }

    // Unable to translate exception, therefore just throw the original!
    throw ex;
  }
View Full Code Here

      List<BatchResult> results = sqlSessionTemplate.flushStatements();

      if (assertUpdates) {
        if (results.size() != 1) {
          throw new InvalidDataAccessResourceUsageException("Batch execution returned invalid results. " +
              "Expected 1 but number of BatchResult objects returned was " + results.size());
        }

        int[] updateCounts = results.get(0).getUpdateCounts();
View Full Code Here

  public static DataAccessException convertHibernateAccessException(HibernateException ex) {
    if (ex instanceof JDBCConnectionException) {
      return new DataAccessResourceFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof SQLGrammarException) {
      return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof DataException) {
      return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof LockAcquisitionException) {
      return new CannotAcquireLockException(ex.getMessage(), ex);
    }
    if (ex instanceof ConstraintViolationException) {
View Full Code Here

          else {
            ps = con.prepareStatement(this.actualSql, PreparedStatement.RETURN_GENERATED_KEYS);
          }
        }
        catch (AbstractMethodError ex) {
          throw new InvalidDataAccessResourceUsageException(
              "The JDBC driver is not compliant to JDBC 3.0 and thus " +
              "does not support retrieval of auto-generated keys", ex);
        }
      }
      else if (resultSetType == ResultSet.TYPE_FORWARD_ONLY && !updatableResults) {
View Full Code Here

          else {
            ps = con.prepareStatement(this.actualSql, PreparedStatement.RETURN_GENERATED_KEYS);
          }
        }
        catch (AbstractMethodError ex) {
          throw new InvalidDataAccessResourceUsageException(
              "The JDBC driver is not compliant to JDBC 3.0 and thus " +
              "does not support retrieval of auto-generated keys", ex);
        }
      }
      else if (resultSetType == ResultSet.TYPE_FORWARD_ONLY && !updatableResults) {
View Full Code Here

    if (ex instanceof JDBCConnectionException) {
      return new DataAccessResourceFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof SQLGrammarException) {
      SQLGrammarException jdbcEx = (SQLGrammarException) ex;
      return new InvalidDataAccessResourceUsageException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof LockAcquisitionException) {
      LockAcquisitionException jdbcEx = (LockAcquisitionException) ex;
      return new CannotAcquireLockException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
View Full Code Here

    if (ex instanceof JDBCConnectionException) {
      return new DataAccessResourceFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof SQLGrammarException) {
      SQLGrammarException jdbcEx = (SQLGrammarException) ex;
      return new InvalidDataAccessResourceUsageException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof LockAcquisitionException) {
      LockAcquisitionException jdbcEx = (LockAcquisitionException) ex;
      return new CannotAcquireLockException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
View Full Code Here

TOP

Related Classes of org.springframework.dao.InvalidDataAccessResourceUsageException

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.