IBasicFile commentsHbmFile =
CdfEngine.getEnvironment().getHibernateConfigurations().getCommentsConfigurationFile();
if ( commentsHbmFile == null || commentsHbmFile.getContents() == null ) {
logger.error( "Unable to find comments hbm file" );
throw new PluginHibernateException( "Unable to find comments hbm file", null );
}
// Close session and rebuild
PluginHibernateUtil.closeSession();
PluginHibernateUtil.getConfiguration().addInputStream( commentsHbmFile.getContents() );
PluginHibernateUtil.rebuildSessionFactory();
} catch ( Exception e ) {
logger.error( "Unable to initialize comments engine", e );
throw new PluginHibernateException( "Unable to initialize comments engine", e );
}
}