use of net.jforum.dao.MySQLVersionWorkarounder in project jforum2 by rafaelsteil.
the class JForum method init.
/**
* @see javax.servlet.Servlet#init(javax.servlet.ServletConfig)
*/
public void init(ServletConfig config) throws ServletException {
super.init(config);
super.startApplication();
// Start database
isDatabaseUp = ForumStartup.startDatabase();
try {
Connection conn = DBConnection.getImplementation().getConnection();
conn.setAutoCommit(!SystemGlobals.getBoolValue(ConfigKeys.DATABASE_USE_TRANSACTIONS));
// Try to fix some MySQL problems
MySQLVersionWorkarounder dw = new MySQLVersionWorkarounder();
dw.handleWorkarounds(conn);
// Continues loading the forum
JForumExecutionContext ex = JForumExecutionContext.get();
ex.setConnection(conn);
JForumExecutionContext.set(ex);
// Init general forum stuff
ForumStartup.startForumRepository();
RankingRepository.loadRanks();
SmiliesRepository.loadSmilies();
BanlistRepository.loadBanlist();
} catch (Throwable e) {
e.printStackTrace();
throw new ForumStartupException("Error while starting jforum", e);
} finally {
JForumExecutionContext.finish();
}
}
Aggregations