pub trait TransactionManager {
    // Required methods
    fn start_tx<'life0, 'async_trait>(
        &'life0 self,
        query_schema: QuerySchemaRef,
        engine_protocol: EngineProtocol,
        opts: TransactionOptions
    ) -> Pin<Box<dyn Future<Output = Result<TxId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn commit_tx<'life0, 'async_trait>(
        &'life0 self,
        tx_id: TxId
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn rollback_tx<'life0, 'async_trait>(
        &'life0 self,
        tx_id: TxId
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn start_tx<'life0, 'async_trait>( &'life0 self, query_schema: QuerySchemaRef, engine_protocol: EngineProtocol, opts: TransactionOptions ) -> Pin<Box<dyn Future<Output = Result<TxId>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Starts a new transaction. Returns ID of newly opened transaction. Expected to throw an error if no transaction could be opened for opts.max_acquisition_millis milliseconds. The new transaction must only live for opts.valid_for_millis milliseconds before it automatically rolls back. This rollback mechanism is an implementation detail of the trait implementer.

source

fn commit_tx<'life0, 'async_trait>( &'life0 self, tx_id: TxId ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Commits a transaction.

source

fn rollback_tx<'life0, 'async_trait>( &'life0 self, tx_id: TxId ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Rolls back a transaction.

Implementors§