On 09/06/2010 11:32 AM, Bernhard Suttner wrote: > I am working with openDBX to connect to a MySQL Database. If the > database server is not available or the database server went away and > comes back later, OpenDBX should reconnect to the database server. > Currently I always get the std::exception "MySQL server has gone > away". How could I recognize that the connection is not up? Is it > possible to reconnect manually the the server if the connection is > broken?
MySQL allows to reconnect to the database server in principle, but it's not used in the OpenDBX library because it's specific to that database and you shouldn't rely on this. The right way to reconnect after catching such an exception would be to create a new Conn instance and call setOption() and bind() with the parameter from the configuration. Norbert ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd _______________________________________________ libopendbx-devel mailing list libopendbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libopendbx-devel http://www.linuxnetworks.de/doc/index.php/OpenDBX