Module: sems
Branch: refs/tags/rel_0.10.0
Commit: 1b265c4c658a6ce48e3aca629f25ec62904a789a
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=1b265c4c658a6ce48e3aca629f25ec62904a789a

Author: Juha Heinanen <[email protected]>
Committer: Juha Heinanen <[email protected]>
Date:   Mon Mar 24 13:30:52 2008 +0000

* Backport of MySQL reconnect option fix from trunk.


git-svn-id: http://svn.berlios.de/svnroot/repos/sems/tags/rel_0.10.0@822 
8eb893ce-cfd4-0310-b710-fb5ebe64c474

---

 apps/conference/Conference.cpp |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/apps/conference/Conference.cpp b/apps/conference/Conference.cpp
index e32a84d..2a340ae 100644
--- a/apps/conference/Conference.cpp
+++ b/apps/conference/Conference.cpp
@@ -172,6 +172,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) {
@@ -179,7 +180,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());

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to