I am running an application on both CentOS 5.5 and Fedora 13. CentOS 5.5
uses mysql-5.0.77-4 and Fedora 13 uses mysql-5.1.47.
I need to be able to auto-reconnect. My application executes the following
code when setting up a connection:
mysqlpp::Connection connection(false);
if (!connection.set_option(new mysqlpp::ReconnectOption(true))) {
// Error handling
}
if (!connection.connect(DB_NAME, DB_HOST, DB_USER, DB_PASSWORD)) {
// Error handling
}
This code used to work on both CentOS 5.4 (mysql-5.0.77-3) and Fedora 13
when using the 3.0.9 version of mysql++, but since I upgraded to mysql++
3.1.0 and CentOS 5.5, the connect call fails with error "Option can only be
set while the connection is established" on CentOS 5.5, although it works on
Fedora 13.
Martin