Examples of QueryTimeoutException


Examples of org.hibernate.QueryTimeoutException

        // query cancelled ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        if ( 1013 == errorCode ) {
          // ORA-01013: user requested cancel of current operation
          throw new QueryTimeoutExceptionmessage, sqlException, sql );
        }


        return null;
      }
View Full Code Here

Examples of org.hibernate.QueryTimeoutException

      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );
        final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException );
        if ( "HY008".equals( sqlState ) ) {
          throw new QueryTimeoutException( message, sqlException, sql );
        }
        if (1222 == errorCode ) {
          throw new LockTimeoutException( message, sqlException, sql );
        }
        return null;
View Full Code Here

Examples of org.hibernate.QueryTimeoutException

      // MySQL Query execution was interrupted
      if ( "70100".equals( sqlState ) ||
        // Oracle user requested cancel of current operation
          "72000".equals( sqlState ) ) {
        throw new QueryTimeoutExceptionmessage, sqlException, sql );
      }
    }

    return null;
  }
View Full Code Here

Examples of org.hibernate.QueryTimeoutException

      // MySQL Query execution was interrupted
      if ( "70100".equals( sqlState ) ||
        // Oracle user requested cancel of current operation
          "72000".equals( sqlState ) ) {
        throw new QueryTimeoutExceptionmessage, sqlException, sql );
      }
    }

    return handledNonSpecificException( sqlException, message, sql );
  }
View Full Code Here

Examples of org.hibernate.QueryTimeoutException

    if (ex instanceof SQLGrammarException) {
      SQLGrammarException jdbcEx = (SQLGrammarException) ex;
      return new InvalidDataAccessResourceUsageException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof QueryTimeoutException) {
      QueryTimeoutException jdbcEx = (QueryTimeoutException) ex;
      return new org.springframework.dao.QueryTimeoutException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof LockAcquisitionException) {
      LockAcquisitionException jdbcEx = (LockAcquisitionException) ex;
      return new CannotAcquireLockException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof PessimisticLockException) {
      PessimisticLockException jdbcEx = (PessimisticLockException) ex;
      return new PessimisticLockingFailureException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof ConstraintViolationException) {
      ConstraintViolationException jdbcEx = (ConstraintViolationException) ex;
      return new DataIntegrityViolationException(ex.getMessage()  + "; SQL [" + jdbcEx.getSQL() +
          "]; constraint [" + jdbcEx.getConstraintName() + "]", ex);
    }
    if (ex instanceof DataException) {
      DataException jdbcEx = (DataException) ex;
      return new DataIntegrityViolationException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof JDBCException) {
      return new HibernateJdbcException((JDBCException) ex);
    }
    // end of JDBCException (subclass) handling
View Full Code Here

Examples of org.hibernate.QueryTimeoutException

    if (ex instanceof SQLGrammarException) {
      SQLGrammarException jdbcEx = (SQLGrammarException) ex;
      return new InvalidDataAccessResourceUsageException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof QueryTimeoutException) {
      QueryTimeoutException jdbcEx = (QueryTimeoutException) ex;
      return new org.springframework.dao.QueryTimeoutException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof LockAcquisitionException) {
      LockAcquisitionException jdbcEx = (LockAcquisitionException) ex;
      return new CannotAcquireLockException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof PessimisticLockException) {
      PessimisticLockException jdbcEx = (PessimisticLockException) ex;
      return new PessimisticLockingFailureException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof ConstraintViolationException) {
      ConstraintViolationException jdbcEx = (ConstraintViolationException) ex;
      return new DataIntegrityViolationException(ex.getMessage()  + "; SQL [" + jdbcEx.getSQL() +
          "]; constraint [" + jdbcEx.getConstraintName() + "]", ex);
    }
    if (ex instanceof DataException) {
      DataException jdbcEx = (DataException) ex;
      return new DataIntegrityViolationException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    // end of JDBCException subclass handling

    if (ex instanceof QueryException) {
      return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
View Full Code Here

Examples of org.hibernate.QueryTimeoutException

    if (ex instanceof SQLGrammarException) {
      SQLGrammarException jdbcEx = (SQLGrammarException) ex;
      return new InvalidDataAccessResourceUsageException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof QueryTimeoutException) {
      QueryTimeoutException jdbcEx = (QueryTimeoutException) ex;
      return new org.springframework.dao.QueryTimeoutException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof LockAcquisitionException) {
      LockAcquisitionException jdbcEx = (LockAcquisitionException) ex;
      return new CannotAcquireLockException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof PessimisticLockException) {
      PessimisticLockException jdbcEx = (PessimisticLockException) ex;
      return new PessimisticLockingFailureException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof ConstraintViolationException) {
      ConstraintViolationException jdbcEx = (ConstraintViolationException) ex;
      return new DataIntegrityViolationException(ex.getMessage()  + "; SQL [" + jdbcEx.getSQL() +
          "]; constraint [" + jdbcEx.getConstraintName() + "]", ex);
    }
    if (ex instanceof DataException) {
      DataException jdbcEx = (DataException) ex;
      return new DataIntegrityViolationException(ex.getMessage() + "; SQL [" + jdbcEx.getSQL() + "]", ex);
    }
    if (ex instanceof JDBCException) {
      return new HibernateJdbcException((JDBCException) ex);
    }
    // end of JDBCException (subclass) handling
View Full Code Here

Examples of org.springframework.dao.QueryTimeoutException

    try {
      return action.doInBucket();
    } catch (RuntimeException e) {
      throw exceptionTranslator.translateExceptionIfPossible(e);
    } catch (TimeoutException e) {
      throw new QueryTimeoutException(e.getMessage(), e);
    } catch (InterruptedException e) {
      throw new OperationInterruptedException(e.getMessage(), e);
    } catch (ExecutionException e) {
      throw new OperationInterruptedException(e.getMessage(), e);
    }
View Full Code Here

Examples of org.springframework.dao.QueryTimeoutException

    SQLException transientConnEx = SQLExceptionSubclassFactory.newSQLTransientConnectionException("", "", 0);
    TransientDataAccessResourceException tdarex = (TransientDataAccessResourceException) sext.translate("task", "SQL", transientConnEx);
    assertEquals(transientConnEx, tdarex.getCause());

    SQLException transientConnEx2 = SQLExceptionSubclassFactory.newSQLTimeoutException("", "", 0);
    QueryTimeoutException tdarex2 = (QueryTimeoutException) sext.translate("task", "SQL", transientConnEx2);
    assertEquals(transientConnEx2, tdarex2.getCause());

    SQLException recoverableEx = SQLExceptionSubclassFactory.newSQLRecoverableException("", "", 0);
    RecoverableDataAccessException rdaex2 = (RecoverableDataAccessException) sext.translate("task", "SQL", recoverableEx);
    assertEquals(recoverableEx, rdaex2.getCause());
View Full Code Here

Examples of org.springframework.dao.QueryTimeoutException

    }

    // For MySQL: exception class name indicating a timeout?
    // (since MySQL doesn't throw the JDBC 4 SQLTimeoutException)
    if (ex.getClass().getName().contains("Timeout")) {
      return new QueryTimeoutException(buildMessage(task, sql, ex), ex);
    }

    // Couldn't resolve anything proper - resort to UncategorizedSQLException.
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.