pub enum TransactionManagerStatus {
Valid(ValidTransactionManagerStatus),
InError,
}
Expand description
Status of the transaction manager
Variants§
Valid(ValidTransactionManagerStatus)
Valid status, the manager can run operations
InError
Error status, probably following a broken connection. The manager will no longer run operations
Implementations§
source§impl TransactionManagerStatus
impl TransactionManagerStatus
sourcepub fn transaction_depth(&self) -> QueryResult<Option<NonZeroU32>>
pub fn transaction_depth(&self) -> QueryResult<Option<NonZeroU32>>
Returns the transaction depth if the transaction manager’s status is valid, or returns
Error::BrokenTransactionManager
if the transaction manager is in error.
sourcepub fn is_not_broken_and_in_transaction(&self) -> bool
👎Deprecated: Removed without replacement
pub fn is_not_broken_and_in_transaction(&self) -> bool
Whether we may be interested in calling
set_top_level_transaction_requires_rollback_if_not_broken
You should typically not need this outside of a custom backend implementation
sourcepub fn set_top_level_transaction_requires_rollback(&mut self)
👎Deprecated: Use set_requires_rollback_maybe_up_to_top_level
instead
pub fn set_top_level_transaction_requires_rollback(&mut self)
set_requires_rollback_maybe_up_to_top_level
insteadIf in transaction and transaction manager is not broken, registers that the connection can not be used anymore until top-level transaction is rolled back
sourcepub fn set_requires_rollback_maybe_up_to_top_level(&mut self, to: bool)
pub fn set_requires_rollback_maybe_up_to_top_level(&mut self, to: bool)
If in transaction and transaction manager is not broken, registers that it’s possible that the connection can not be used anymore until top-level transaction is rolled back.
If that is registered, savepoints rollbacks will still be attempted, but failure to do so will not result in an error. (Some may succeed, some may not.)
sourcepub fn set_in_error(&mut self)
pub fn set_in_error(&mut self)
Sets the transaction manager status to InError
Subsequent attempts to use transaction-related features will result in a
Error::BrokenTransactionManager
error