Package org.hibernate

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


    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

    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

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

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


        return null;
      }
View Full Code Here

    if ( index >= topDocs.scoreDocs.length ) {
      updateTopDocs( 2 * index );
    }
    //if the refresh timed out, raise an exception
    if ( timeoutManager.isTimedOut() && index >= topDocs.scoreDocs.length ) {
      throw new QueryTimeoutException(
          "Timeout period exceeded. Cannot load document: " + index,
          (SQLException) null,
          preparedQuery.toString()
      );
    }
View Full Code Here

    }
    else {
      final long elapsedTime = currentTime - start;
      timedOut = elapsedTime > timeout;
      if ( this.type != Type.LIMIT && timedOut ) {
        throw new QueryTimeoutException(
            "Full-text query took longer than expected (in microsecond): " + TimeUnit.NANOSECONDS.toMicros( elapsedTime ),
            ( SQLException) null,
            luceneQuery.toString()
        );
      }
View Full Code Here

      //we stop where we are return what we have
      this.partialResults = true;
    }
    else {
      if ( e == null) {
        e = new QueryTimeoutException( "Timeout period exceeded", (SQLException) null, luceneQuery.toString() );
      }
      throw e;
    }
  }
View Full Code Here

    if ( index >= topDocs.scoreDocs.length ) {
      updateTopDocs( 2 * index );
    }
    //if the refresh timed out, raise an exception
    if ( timeoutManager.isTimedOut() && index >= topDocs.scoreDocs.length ) {
      throw new QueryTimeoutException(
          "Timeout period exceeded. Cannot load document: " + index,
          (SQLException) null,
          preparedQuery.toString()
      );
    }
View Full Code Here

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

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


        // data integrity violation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View Full Code Here

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

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


        // data integrity violation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View Full Code Here

TOP

Related Classes of org.hibernate.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.