pub trait TransactionManager {
// Required methods
fn start_tx<'life0, 'async_trait>(
&'life0 self,
query_schema: Arc<QuerySchema>,
engine_protocol: EngineProtocol,
opts: TransactionOptions
) -> Pin<Box<dyn Future<Output = Result<TxId, CoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn commit_tx<'life0, 'async_trait>(
&'life0 self,
tx_id: TxId
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn rollback_tx<'life0, 'async_trait>(
&'life0 self,
tx_id: TxId
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}
Required Methods§
sourcefn start_tx<'life0, 'async_trait>(
&'life0 self,
query_schema: Arc<QuerySchema>,
engine_protocol: EngineProtocol,
opts: TransactionOptions
) -> Pin<Box<dyn Future<Output = Result<TxId, CoreError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn start_tx<'life0, 'async_trait>( &'life0 self, query_schema: Arc<QuerySchema>, engine_protocol: EngineProtocol, opts: TransactionOptions ) -> Pin<Box<dyn Future<Output = Result<TxId, CoreError>> + Send + 'async_trait>>where 'life0: 'async_trait, Self: '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.