mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-21 02:00:33 +01:00
better logging if rollback fails with Exception
This commit is contained in:
parent
443e54fdde
commit
b30da7bcca
@ -51,6 +51,11 @@ Transaction::~Transaction()
|
|||||||
|
|
||||||
_rSession.rollback();
|
_rSession.rollback();
|
||||||
}
|
}
|
||||||
|
catch (Poco::Exception& exc)
|
||||||
|
{
|
||||||
|
if (_pLogger)
|
||||||
|
_pLogger->error("Error while rolling back database transaction: %s", exc.displayText());
|
||||||
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
if (_pLogger)
|
if (_pLogger)
|
||||||
@ -93,7 +98,7 @@ void Transaction::execute(const std::vector<std::string>& sql)
|
|||||||
}
|
}
|
||||||
catch (Exception& ex)
|
catch (Exception& ex)
|
||||||
{
|
{
|
||||||
if (_pLogger) _pLogger->error(ex.displayText());
|
if (_pLogger) _pLogger->log(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
rollback();
|
rollback();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user