public void freezeDatabase(String profileId) {
ApplicationContext ctx = profileInstanceManagers.get(profileId);
DerbyPooledDataSource dataSource = (DerbyPooledDataSource) ctx
.getBean(DATA_SOURCE_BEAN_NAME);
try {
dataSource.freeze();
//CHECKSTYLE:OFF no choice here - the datasource throws Exception
} catch (Exception e) {
// CHECKSTYLE:ON
throw new RuntimeException(e.getMessage(), e);
}