Package org.springframework.dao

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


    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

    }

    // 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

      }
      else if (ex instanceof SQLTransactionRollbackException) {
        return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
      }
      else if (ex instanceof SQLTimeoutException) {
        return new QueryTimeoutException(buildMessage(task, sql, ex), ex);
      }
    }
    else if (ex instanceof SQLNonTransientException) {
      if (ex instanceof SQLNonTransientConnectionException) {
        return new DataAccessResourceFailureException(buildMessage(task, sql, ex), ex);
View Full Code Here

        ResultSetFuture rsf = s.executeAsync(statement);
        ResultSet rs = null;
        try {
          rs = rsf.get(timeout, timeUnit);
        } catch (TimeoutException e) {
          throw new QueryTimeoutException("Asyncronous Query Timed Out.", e);
        } catch (InterruptedException e) {
          throw translateExceptionIfPossible(e);
        } catch (ExecutionException e) {
          if (e.getCause() instanceof Exception) {
            throw translateExceptionIfPossible((Exception) e.getCause());
View Full Code Here

    if (ex instanceof ChannelException) {
      return new RedisConnectionFailureException("Redis connection failed", ex);
    }

    if (ex instanceof TimeoutException) {
      return new QueryTimeoutException("Redis command timed out", ex);
    }

    return null;
  }
View Full Code Here

      }
      if (done) {
        return results;
      }

      throw new RedisPipelineException(new QueryTimeoutException("Redis command timed out"));
    }

    return Collections.emptyList();
  }
View Full Code Here

TOP

Related Classes of org.springframework.dao.QueryTimeoutException

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.