Package org.springframework.dao

Examples of org.springframework.dao.PessimisticLockingFailureException


    }
    if (ex instanceof LockTimeoutException) {
      return new CannotAcquireLockException(ex.getMessage(), ex);
    }
    if (ex instanceof PessimisticLockException) {
      return new PessimisticLockingFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof OptimisticLockException) {
      return new JpaOptimisticLockingFailureException((OptimisticLockException) ex);
    }
    if (ex instanceof EntityExistsException) {
View Full Code Here


      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

    if (ex instanceof QueryException) {
      return new HibernateQueryException((QueryException) ex);
    }
    if (ex instanceof NonUniqueResultException) {
      return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1, ex);
    }
    if (ex instanceof NonUniqueObjectException) {
      return new DuplicateKeyException(ex.getMessage(), ex);
    }
    if (ex instanceof PropertyValueException) {
      return new DataIntegrityViolationException(ex.getMessage(), ex);
    }
    if (ex instanceof PersistentObjectException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof TransientObjectException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof ObjectDeletedException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof UnresolvableObjectException) {
      return new HibernateObjectRetrievalFailureException((UnresolvableObjectException) ex);
    }
    if (ex instanceof WrongClassException) {
      return new HibernateObjectRetrievalFailureException((WrongClassException) ex);
    }
    if (ex instanceof StaleObjectStateException) {
      return new HibernateOptimisticLockingFailureException((StaleObjectStateException) ex);
    }
    if (ex instanceof StaleStateException) {
      return new HibernateOptimisticLockingFailureException((StaleStateException) ex);
    }
    if (ex instanceof OptimisticEntityLockException) {
      return new HibernateOptimisticLockingFailureException((OptimisticEntityLockException) ex);
    }
    if (ex instanceof PessimisticEntityLockException) {
      if (ex.getCause() instanceof LockAcquisitionException) {
        return new CannotAcquireLockException(ex.getMessage(), ex.getCause());
      }
      return new PessimisticLockingFailureException(ex.getMessage(), ex);
    }

    // fallback
    return new HibernateSystemException(ex);
  }
View Full Code Here

      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);
    }
    if (ex instanceof NonUniqueResultException) {
      return new IncorrectResultSizeDataAccessException(ex.getMessage(), 1, ex);
    }
    if (ex instanceof NonUniqueObjectException) {
      return new DuplicateKeyException(ex.getMessage(), ex);
    }
    if (ex instanceof PropertyValueException) {
      return new DataIntegrityViolationException(ex.getMessage(), ex);
    }
    if (ex instanceof PersistentObjectException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof TransientObjectException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof ObjectDeletedException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof UnresolvableObjectException) {
      UnresolvableObjectException hibEx = (UnresolvableObjectException) ex;
      return new ObjectRetrievalFailureException(hibEx.getEntityName(), hibEx.getIdentifier(), ex.getMessage(), ex);
    }
    if (ex instanceof WrongClassException) {
      WrongClassException hibEx = (WrongClassException) ex;
      return new ObjectRetrievalFailureException(hibEx.getEntityName(), hibEx.getIdentifier(), ex.getMessage(), ex);
    }
    if (ex instanceof StaleObjectStateException) {
      StaleObjectStateException hibEx = (StaleObjectStateException) ex;
      return new ObjectOptimisticLockingFailureException(hibEx.getEntityName(), hibEx.getIdentifier(), ex);
    }
    if (ex instanceof StaleStateException) {
      return new ObjectOptimisticLockingFailureException(ex.getMessage(), ex);
    }
    if (optimisticLockExceptionClass.isInstance(ex)) {
      return new ObjectOptimisticLockingFailureException(ex.getMessage(), ex);
    }
    if (pessimisticLockExceptionClass != null && pessimisticLockExceptionClass.isInstance(ex)) {
      if (ex.getCause() instanceof LockAcquisitionException) {
        return new CannotAcquireLockException(ex.getMessage(), ex.getCause());
      }
      return new PessimisticLockingFailureException(ex.getMessage(), ex);
    }

    // fallback
    return new JpaSystemException(ex);
  }
View Full Code Here

      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);
View Full Code Here

      }
      if (ex instanceof EntryDestroyedException) {
        return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
      }
      if (ex instanceof FailedSynchronizationException) {
        return new PessimisticLockingFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof IndexMaintenanceException) {
        return new GemfireIndexException((IndexMaintenanceException) ex);
      }
      if (ex instanceof OperationAbortedException) {
        // treat user exceptions first
        if (ex instanceof CacheLoaderException) {
          return new GemfireSystemException(ex);
        }
        if (ex instanceof CacheWriterException) {
          return new GemfireSystemException(ex);
        }
        // the rest are treated as resource failures
        return new DataAccessResourceFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof PartitionedRegionDistributionException) {
        return new DataAccessResourceFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof PartitionedRegionStorageException) {
        return new DataAccessResourceFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof QueryExecutionTimeoutException) {
        return new GemfireQueryException((QueryExecutionTimeoutException) ex);
      }
      if (ex instanceof RegionDestroyedException) {
        return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
      }
      if (ex instanceof com.gemstone.gemfire.admin.RegionNotFoundException) {
        return new InvalidDataAccessResourceUsageException(ex.getMessage(), ex);
      }
      if (ex instanceof ResourceException) {
        return new DataAccessResourceFailureException(ex.getMessage(), ex);
      }
      if (ex instanceof RoleException) {
        return new GemfireSystemException(ex);
      }
      if (ex instanceof StatisticsDisabledException) {
        return new GemfireSystemException(ex);
      }
      if (ex instanceof SynchronizationCommitConflictException) {
        return new PessimisticLockingFailureException(ex.getMessage(), ex);
      }
    }
    if (ex instanceof CopyException) {
      return new GemfireSystemException(ex);
    }
    if (ex instanceof com.gemstone.gemfire.cache.EntryNotFoundInRegion) {
      return new DataRetrievalFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof FunctionException) {
      return new InvalidDataAccessApiUsageException(ex.getMessage(), ex);
    }
    if (ex instanceof GemFireCacheException) {
      return convertGemfireAccessException(((GemFireCacheException) ex).getCacheException());
    }
    if (ex instanceof GemFireConfigException) {
      return new GemfireSystemException(ex);
    }
    if (ex instanceof GemFireIOException) {
      return new DataAccessResourceFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof GemFireSecurityException) {
      return new PermissionDeniedDataAccessException(ex.getMessage(), ex);
    }
    if (ex instanceof IncompatibleSystemException) {
      return new GemfireSystemException(ex);
    }
    if (ex instanceof InternalGemFireException) {
      return new GemfireSystemException(ex);
    }
    if (ex instanceof InvalidValueException) {
      return new TypeMismatchDataAccessException(ex.getMessage(), ex);
    }
    if (ex instanceof LeaseExpiredException) {
      return new PessimisticLockingFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof LicenseException) {
      return new GemfireSystemException(ex);
    }
    if (ex instanceof NoSystemException) {
View Full Code Here

TOP

Related Classes of org.springframework.dao.PessimisticLockingFailureException

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.