Hi all,
I have found a bug.
mysqlpp::transaction's destructor can throw exceptions.
destructors should never throw.
If I am using the transaction object and then mysql "goes away" resulting in one of my
queries failing during the transaction, throwing an exception to indicate the failure.
The transaction is destroyed during stack unwind, and as intended rolls back the
transaction.
The roll back fails for the same reason as the query failed that is causing the roll back.
So then we get a second exception whilst unwinding the stack for the first exception.
The necessary fix is to wrap the contents of ~transaction in a try {} catch (...)
statement.
Alex