Tracking for heavy operations while having active transactions.
Some operations, like http requests, are heavy and can take too long during an incident. If they are called during an active database transaction, connection will be held for longer and connection pool will be exhausted. Transaction tracker prevents this by holding counter of active transactions in TaskLocalVariable and checking for active transactions in heavy operaions.
Classes | |
class | CheckDisabler |
Disable check for active transactions. More... | |
struct | TransactionTrackerStatistics |
Statistics for transaction tracker. More... | |
Functions | |
void | StartTransaction () |
Increment transaction counter. | |
void | EndTransaction () noexcept |
Decrement transaction counter. | |
void | CheckNoTransactions (utils::impl::SourceLocation location=utils::impl::SourceLocation::Current()) |
Check for active transactions. | |
TransactionTrackerStatistics | GetStatistics () noexcept |
Get statistics for transaction tracker. | |
void | ResetStatistics () |
Reset statistics for transaction tracker. | |
|
noexcept |
Decrement transaction counter.
If called before StartTransaction, the behavior is undefined.