better logging if rollback fails with Exception

This commit is contained in:
Guenter Obiltschnig 2016-03-12 20:39:51 +01:00
parent 443e54fdde
commit b30da7bcca

View File

@ -51,6 +51,11 @@ Transaction::~Transaction()
_rSession.rollback();
}
catch (Poco::Exception& exc)
{
if (_pLogger)
_pLogger->error("Error while rolling back database transaction: %s", exc.displayText());
}
catch (...)
{
if (_pLogger)
@ -93,7 +98,7 @@ void Transaction::execute(const std::vector<std::string>& sql)
}
catch (Exception& ex)
{
if (_pLogger) _pLogger->error(ex.displayText());
if (_pLogger) _pLogger->log(ex);
}
rollback();