* Set reconnect option so that MySQL connection is automatically

restored in case of server restart.


git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@821 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Juha Heinanen 19 years ago
parent 9152aad8ff
commit 18d97431a5

@ -173,6 +173,7 @@ int ConferenceFactory::onLoad()
try {
Connection.set_option(Connection.opt_reconnect, true);
Connection.connect(mysql_db.c_str(), mysql_server.c_str(),
mysql_user.c_str(), mysql_passwd.c_str());
if (!Connection) {
@ -180,7 +181,12 @@ int ConferenceFactory::onLoad()
return -1;
}
}
catch (const mysqlpp::BadOption& er) {
ERROR("MySQL++ set_option error: %s\n", er.what());
return -1;
}
catch (const mysqlpp::Exception& er) {
// Catch-all for any MySQL++ exceptions
ERROR("MySQL++ error: %s\n", er.what());

@ -191,6 +191,7 @@ int EarlyAnnounceFactory::onLoad()
try {
Connection.set_option(Connection.opt_reconnect, true);
Connection.connect(mysql_db.c_str(), mysql_server.c_str(),
mysql_user.c_str(), mysql_passwd.c_str());
if (!Connection) {
@ -198,7 +199,12 @@ int EarlyAnnounceFactory::onLoad()
return -1;
}
}
catch (const mysqlpp::BadOption& er) {
ERROR("MySQL++ set_option error: %s\n", er.what());
return -1;
}
catch (const mysqlpp::Exception& er) {
// Catch-all for any MySQL++ exceptions
ERROR("MySQL++ error: %s\n", er.what());

Loading…
Cancel
Save