Package org.springframework.dao

Examples of org.springframework.dao.ConcurrencyFailureException


    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


      }
      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);
      }
    }

    // For MySQL: exception class name indicating a timeout?
    // (since MySQL doesn't throw the JDBC 4 SQLTimeoutException)
View Full Code Here

    if (ex instanceof SQLTransientException) {
      if (ex instanceof SQLTransientConnectionException) {
        return new TransientDataAccessResourceException(buildMessage(task, sql, ex), ex);
      }
      else if (ex instanceof SQLTransactionRollbackException) {
        return new ConcurrencyFailureException(buildMessage(task, sql, ex), ex);
      }
      else if (ex instanceof SQLTimeoutException) {
        return new QueryTimeoutException(buildMessage(task, sql, ex), ex);
      }
    }
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

  @Override
  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

                executor.execute(task);
            }
            try {
                latch.await();
            } catch (InterruptedException e) {
                throw new ConcurrencyFailureException(
                        "unexpected interruption when re-arranging parameter collection into sub-collections ",
                        e);
            }

            if (exceptionStaktrace.length() > 0) {
                throw new ConcurrencyFailureException(
                        "unpected exception when re-arranging parameter collection, check previous log for details.\n"
                                + exceptionStaktrace);
            }
        } finally {
            executor.shutdown();
View Full Code Here

            }

            try {
                latch.await();
            } catch (InterruptedException e) {
                throw new ConcurrencyFailureException(
                        "interrupted when processing data access request in concurrency", e);
            }

        } finally {
            for (RequestDepository depo : requestsDepo) {
View Full Code Here

                                                 List<Object> resultList) {
        for (Future<Object> future : futures) {
            try {
                resultList.add(future.get());
            } catch (InterruptedException e) {
                throw new ConcurrencyFailureException(
                        "interrupted when processing data access request in concurrency", e);
            } catch (ExecutionException e) {
                throw new ConcurrencyFailureException("something goes wrong in processing", e);
            }
        }
    }
View Full Code Here

            if (createTileSet(tileSet)) {
                return tileSet;
            }
        }

        throw new ConcurrencyFailureException("Failed to create or locate tileset " + tileSet
                + " after " + maxLoops + " attempts");
    }
View Full Code Here

                        }
                    }
                }

                if (modified == 0) {
                    throw new ConcurrencyFailureException(
                            "Failed to create or update page stats for page " + payload.getPage()
                                    + " after " + count + " attempts");
                }
            }
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.