Package org.springframework.dao

Examples of org.springframework.dao.ConcurrencyFailureException


    }
    if (ex instanceof ConstraintViolationException) {
      return new DataIntegrityViolationException("Constraint has been violated", ex);
    }
    if (ex instanceof InvalidItemStateException) {
      return new ConcurrencyFailureException("Invalid item state", ex);
    }
    if (ex instanceof InvalidQueryException) {
      return new DataRetrievalFailureException("Invalid query", ex);
    }
    if (ex instanceof InvalidSerializedDataException) {
      return new DataRetrievalFailureException("Invalid serialized data", ex);
    }
    if (ex instanceof ItemExistsException) {
      return new DataIntegrityViolationException("An item already exists", ex);
    }
    if (ex instanceof ItemNotFoundException) {
      return new DataRetrievalFailureException("Item not found", ex);
    }
    if (ex instanceof LoginException) {
      return new DataAccessResourceFailureException("Bad login", ex);
    }
    if (ex instanceof LockException) {
      return new ConcurrencyFailureException("Item is locked", ex);
    }
    if (ex instanceof MergeException) {
      return new DataIntegrityViolationException("Merge failed", ex);
    }
    if (ex instanceof NamespaceException) {
View Full Code Here


      }
      else if (RESOURCE_FAILURE_CODES.contains(classCode)) {
        return new DataAccessResourceFailureException(buildMessage(task, sql, ex), ex);
      }
      else if (CONCURRENCY_CODES.contains(classCode)) {
        return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
      }
    }
    // We couldn't identify it more precisely.
    return new UncategorizedSQLException(task, sql, ex);
  }
View Full Code Here

      }
      else if (RESOURCE_FAILURE_CODES.contains(classCode)) {
        return new DataAccessResourceFailureException(buildMessage(task, sql, ex), ex);
      }
      else if (CONCURRENCY_CODES.contains(classCode)) {
        return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
      }
    }
    // We couldn't identify it more precisely.
    return new UncategorizedSQLException(task, sql, ex);
  }
View Full Code Here

    }
    if (ex instanceof QueryException) {
      return new TopLinkQueryException((QueryException) ex);
    }
    if (ex instanceof ConcurrencyException) {
      return new ConcurrencyFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof ConversionException) {
      return new TypeMismatchDataAccessException(ex.getMessage(), ex);
    }
    // fallback
View Full Code Here

      }
      else if (TRANSIENT_DATA_ACCESS_RESOURCE_CODES.contains(classCode)) {
        return new TransientDataAccessResourceException(buildMessage(task, sql, ex), ex);
      }
      else if (CONCURRENCY_FAILURE_CODES.contains(classCode)) {
        return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
      }
    }
    return null;
  }
View Full Code Here

  }

  protected DataAccessException doTranslate(String task, String sql, SQLException ex) {
    if (ex instanceof SQLTransientException) {
      if (ex instanceof SQLTransactionRollbackException) {
        return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
      }
      if (ex instanceof SQLTransientConnectionException) {
        return new TransientDataAccessResourceException(buildMessage(task, sql, ex), ex);
      }
      if (ex instanceof SQLTimeoutException) {
View Full Code Here

    }
    if (ex instanceof QueryException) {
      return new TopLinkQueryException((QueryException) ex);
    }
    if (ex instanceof ConcurrencyException) {
      return new ConcurrencyFailureException(ex.getMessage(), ex);
    }
    if (ex instanceof ConversionException) {
      return new TypeMismatchDataAccessException(ex.getMessage(), ex);
    }
    // fallback
View Full Code Here

      }
      else if (RESOURCE_FAILURE_CODES.contains(classCode)) {
        return new DataAccessResourceFailureException(buildMessage(task, sql, ex), ex);
      }
      else if (CONCURRENCY_CODES.contains(classCode)) {
        return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
      }
    }
    // We couldn't identify it more precisely.
    return new UncategorizedSQLException(task, sql, ex);
  }
View Full Code Here

    BadSqlGrammarException bsgex2 = (BadSqlGrammarException) sext.translate("task", "SQL2", badSqlEx2);
    assertEquals("SQL2", bsgex2.getSql());
    assertEquals(badSqlEx2, bsgex2.getSQLException());

    SQLException tranRollbackEx = SQLExceptionSubclassFactory.newSQLTransactionRollbackException("", "", 0);
    ConcurrencyFailureException cfex = (ConcurrencyFailureException) sext.translate("task", "SQL", tranRollbackEx);
    assertEquals(tranRollbackEx, cfex.getCause());

    SQLException transientConnEx = SQLExceptionSubclassFactory.newSQLTransientConnectionException("", "", 0);
    TransientDataAccessResourceException tdarex = (TransientDataAccessResourceException) sext.translate("task", "SQL", transientConnEx);
    assertEquals(transientConnEx, tdarex.getCause());
View Full Code Here

     *
     * @see com.pm.core.data.EntityMapperForRootAgregate#delete(com.pm.core.domain.Entity)
     */
    public void delete(final Object entity) {

        throw new ConcurrencyFailureException("m�thode non impl�ment�e");

    }
View Full Code Here

TOP

Related Classes of org.springframework.dao.ConcurrencyFailureException

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.