Re: [Cppcms-users] How to reconnect to MySQL
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2011-12-21 22:49:16
|
Fixed in trunk of cppdb. Now if exception is thrown during use of a connection the connection is not recycled. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ >________________________________ > From: 陈抒 <csf...@gm...> >To: cpp...@li... >Sent: Monday, December 5, 2011 6:03 PM >Subject: [Cppcms-users] How to reconnect to MySQL > > >Hello, > My web site's DB connection broke because of timeout. My web site is developed in China,but MySQL server is running in the USA. I got one error log: >2011-12-05 15:43:02 GMT; cppcms, error: Caught exception [cppdb::mysql::Lost connection to MySQL server during query] > (http_context.cpp:150) > > > I have used reconnect property already: > stringstream stream; > stream<<"mysql:host="<<config.mysql_ip<<";database="<<config.mysql_db_name<<";user="<<config.mysql_user<<";password="<<config.mysql_password<<";@pool_size=20;set_charset_name=utf8;opt_reconnect=1"; > > > But it didn't work. How should I do? Catch exception and call cppdb::connections_manager::gc() ? > > >陈抒 >Best regards >http://blog.csdn.net/sheismylife > >------------------------------------------------------------------------------ >All the data continuously generated in your IT infrastructure >contains a definitive record of customers, application performance, >security threats, fraudulent activity, and more. Splunk takes this >data and makes sense of it. IT sense. And common sense. >http://p.sf.net/sfu/splunk-novd2d >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |