Skip to main content

TransactionService

Trait TransactionService 

Source
pub trait TransactionService: Send + Sync {
    // Required methods
    fn begin(
        &self,
        session_id: SessionId,
        isolation: IsolationLevel,
    ) -> BoxFuture<'_, TransactionId>;
    fn commit(&self, session_id: SessionId) -> BoxFuture<'_, ()>;
    fn rollback(&self, session_id: SessionId) -> BoxFuture<'_, ()>;
}
Expand description

Explicit transaction control on a session (S1D-003).

Required Methods§

Source

fn begin( &self, session_id: SessionId, isolation: IsolationLevel, ) -> BoxFuture<'_, TransactionId>

Begins a transaction at the requested isolation level.

Source

fn commit(&self, session_id: SessionId) -> BoxFuture<'_, ()>

Commits the session’s active transaction. Commit failures carry the transaction categories of the taxonomy (e.g. mongreldb_types::errors::ErrorCategory::TransactionConflict, mongreldb_types::errors::ErrorCategory::CommitOutcomeUnknown); an ambiguous outcome is only replayed with a durable idempotency key (spec section 11.7).

Source

fn rollback(&self, session_id: SessionId) -> BoxFuture<'_, ()>

Rolls back the session’s active transaction.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§