Package org.springframework.dao

Examples of org.springframework.dao.DataAccessResourceFailureException


      }
      long elapsedTime = System.currentTimeMillis() - startTime;
      logger.info("Done executing SQL scriptBuilder '" + sqlResourcePath + "' in " + elapsedTime + " ms");
    }
    catch (IOException ex) {
      throw new DataAccessResourceFailureException("Failed to open SQL script '" + sqlResourcePath + "'", ex);
    }
  }
View Full Code Here


      try {
        EntityManager em = createEntityManager(emf);
        TransactionSynchronizationManager.bindResource(emf, new EntityManagerHolder(em));
      }
      catch (PersistenceException ex) {
        throw new DataAccessResourceFailureException("Could not create JPA EntityManager", ex);
      }
    }

    try {
      filterChain.doFilter(request, response);
View Full Code Here

          logger.debug("Found Hibernate-managed Session [" + session + "] for Spring-managed transaction");
        }
        txObject.setExistingSession(session);
      }
      catch (HibernateException ex) {
        throw new DataAccessResourceFailureException(
            "Could not obtain Hibernate-managed Session for Spring-managed transaction", ex);
      }
    }

    if (getDataSource() != null) {
View Full Code Here

      throws DataAccessResourceFailureException {
    try {
      return doGetTransactionalEntityManager(emf, properties);
    }
    catch (PersistenceException ex) {
      throw new DataAccessResourceFailureException("Could not obtain JPA EntityManager", ex);
    }
  }
View Full Code Here

        for (int i = 0; i < getCacheSize(); i++) {
          stmt.executeUpdate(getIncrementStatement());
          ResultSet rs = stmt.executeQuery("select @@identity");
          try {
            if (!rs.next()) {
              throw new DataAccessResourceFailureException("@@identity failed after executing an update");
            }
            this.valueCache[i] = rs.getLong(1);
          }
          finally {
            JdbcUtils.closeResultSet(rs);
          }
        }
        long maxValue = this.valueCache[(this.valueCache.length - 1)];
        stmt.executeUpdate("delete from " + getIncrementerName() + " where " + getColumnName() + " < " + maxValue);
      }
      catch (SQLException ex) {
        throw new DataAccessResourceFailureException("Could not increment identity", ex);
      }
      finally {
        JdbcUtils.closeStatement(stmt);
        DataSourceUtils.releaseConnection(con, getDataSource());
      }
View Full Code Here

    try {
      return doGetPersistenceManager(pmf, allowCreate);
    }
    catch (JDOException ex) {
      throw new DataAccessResourceFailureException("Could not obtain JDO PersistenceManager", ex);
    }
  }
View Full Code Here

          // ignore
        }
      }
    }
    catch (Exception ex) {
      throw new DataAccessResourceFailureException("Failed to execute database script", ex);
    }
  }
View Full Code Here

    try {
      return doGetSession(sessionFactory, null, null, allowCreate);
    }
    catch (HibernateException ex) {
      throw new DataAccessResourceFailureException("Could not open Hibernate Session", ex);
    }
  }
View Full Code Here

    try {
      return doGetSession(sessionFactory, entityInterceptor, jdbcExceptionTranslator, true);
    }
    catch (HibernateException ex) {
      throw new DataAccessResourceFailureException("Could not open Hibernate Session", ex);
    }
  }
View Full Code Here

        // No transaction active -> simply return default thread-bound Session, if any
        // (possibly from OpenSessionInViewFilter/Interceptor).
        return sessionHolder.getValidatedSession();
      }
      catch (Throwable ex) {
        throw new DataAccessResourceFailureException("Could not check JTA transaction", ex);
      }
    }
    else {
      // No JTA TransactionManager -> simply return default thread-bound Session, if any
      // (possibly from OpenSessionInViewFilter/Interceptor).
View Full Code Here

TOP

Related Classes of org.springframework.dao.DataAccessResourceFailureException

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.