Hibernate ORM PessimisticLockException - 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 PessimisticLockException class.

This code example shows how to use the following methods:getSQL
			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 
6
CodeRank
This code example shows how to use the following methods:
				return new LockAcquisitionException( message, sqlException, sql );
			} 
 
			if ( "40XL1".equals( sqlState ) || "40XL2".equals( sqlState )) {
				// Derby "A lock could not be obtained within the time requested." 
				return new PessimisticLockException( message, sqlException, sql );
			} 
 
			// 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 );
	} 
 
	/** 
4
CodeRank