Package org.hibernate

Examples of org.hibernate.QueryTimeoutException


    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() );
    }
    return topDocs.scoreDocs[index];
  }
View Full Code Here


    }
    else {
      final long elapsedTime = currentTime - start;
      timedOut = elapsedTime > timeout;
      if ( this.type != Type.LIMIT  ) {
        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

    }
    else if ( SQLSyntaxErrorException.class.isInstance( sqlException ) ) {
      return new SQLGrammarException( message, sqlException, sql );
    }
    else if ( SQLTimeoutException.class.isInstance( sqlException ) ) {
      return new QueryTimeoutException( message, sqlException, sql );
    }
    else if ( SQLTransactionRollbackException.class.isInstance( sqlException ) ) {
      // Not 100% sure this is completely accurate.  The JavaDocs for SQLTransactionRollbackException state that
      // it indicates sql states starting with '40' and that those usually indicate that:
      //    <quote>
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

      @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

      @Override
      public JDBCException convert(SQLException sqlException, String message, String sql) {
        final String sqlState = JdbcExceptionHelper.extractSqlState( sqlException );

        if"HY008".equals( sqlState )){
          throw new QueryTimeoutException( message, sqlException, sql );
        }
        return null;
      }
    };
  }
View Full Code Here

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

    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

      @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

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.