use of org.springframework.dao.DataAccessResourceFailureException in project uPortal by Jasig.
the class DatabaseMetaDataImpl method runDatabaseTests.
/**
* Run a set of tests on the database to provide better meta data.
*/
private void runDatabaseTests() {
Connection conn = null;
try {
conn = this.dataSource.getConnection();
// The order of these tests is IMPORTANT, each may depend on the
// results of the previous tests.
this.getMetaData(conn);
final JdbcTemplate jdbcTemplate = new JdbcTemplate(this.dataSource);
this.testDatabaseInitialized(jdbcTemplate);
if (this.portalTablesExist) {
this.testOuterJoins(jdbcTemplate);
this.testTimeStamp(jdbcTemplate);
}
} catch (SQLException e) {
LOG.error("Error during database initialization. ", e);
/*
* We must throw a RuntimeException here to avoid starting the portal
* with incorrect assumptions about what the database supports.
*/
throw new DataAccessResourceFailureException("Error during database initialization. ", e);
} finally {
this.releaseConnection(conn);
}
}
Aggregations