Hibernate ORM QueryTimeoutException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM QueryTimeoutException class.

This code example shows how to use the following methods: getSQL
			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); 
		} 
Full Snippet Info
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
			// MySQL Query execution was interrupted 
			if ( "70100".equals( sqlState ) ||
				// Oracle user requested cancel of current operation 
				  "72000".equals( sqlState ) ) {
				throw new QueryTimeoutException(  message, sqlException, sql );
			} 
		} 
 
		return handledNonSpecificException( sqlException, message, sql );
	} 
 
	/** 
	 * Handle an exception not converted to a specific type based on the SQLState. 
	 * 
	 * @param sqlException The exception to be handled. 
	 * @param message      An optional message 
	 * @param sql          Optionally, the sql being performed when the exception occurred. 
	 * @return The converted exception; should <b>never</b> be null. 
	 */ 
Full Snippet Info
4
CodeRank
Experience pair programming with AI  Get Codota for Java