Package org.springframework.dao

Examples of org.springframework.dao.DataAccessResourceFailureException


        for (int i = 0; i < getCacheSize(); i++) {
          stmt.executeUpdate("insert into " + getIncrementerName() + " (" + getDummyName() + ") values(null)");
          ResultSet rs = stmt.executeQuery("select IDENTITY_VAL_LOCAL() from " + getIncrementerName());
          try {
            if (!rs.next()) {
              throw new DataAccessResourceFailureException("IDENTITY_VAL_LOCAL() 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 obtain IDENTITY value", 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

          return provider;
        }
      });
    }
    catch (MetaDataAccessException ex) {
      throw new DataAccessResourceFailureException("Error retreiving database metadata", ex);
    }

  }
View Full Code Here

          }
          return provider;
        }
      });
    } catch (MetaDataAccessException e) {
      throw new DataAccessResourceFailureException("Error retreiving database metadata", e);
    }

  }
View Full Code Here

          tmd = tableMeta.get("PUBLIC");
          if (tmd == null) {
            tmd = tableMeta.get("DBO");
          }
          if (tmd == null) {
            throw new DataAccessResourceFailureException("Unable to locate table meta data for '" + tableName + "' in the default schema");
          }
        }
      }
      else {
        tmd = tableMeta.get(schemaName.toUpperCase());
        if (tmd == null) {
          throw new DataAccessResourceFailureException("Unable to locate table meta data for '" + tableName + "' in the '" + schemaName + "' schema");
        }
      }

      processTableColumns(databaseMetaData, tmd);
    }
View Full Code Here

      // Hibernate Session per currently active/suspended transaction).
      try {
        this.jtaTransaction = jtaTm.getTransaction();
      }
      catch (SystemException ex) {
        throw new DataAccessResourceFailureException("Could not access JTA transaction", 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

            }
          }
        }
      }
      catch (Throwable ex) {
        throw new DataAccessResourceFailureException(
            "Could not register synchronization with JTA TransactionManager", ex);
      }
    }
  }
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.