Skip to main content

KernelTransaction

Trait KernelTransaction 

Source
pub trait KernelTransaction: Send + Sync {
    // Required methods
    fn begin(&self) -> KernelResult<TransactionId>;
    fn begin_with_isolation(
        &self,
        isolation: IsolationLevel,
    ) -> KernelResult<TransactionId>;
    fn commit(&self, txn_id: TransactionId) -> KernelResult<()>;
    fn abort(&self, txn_id: TransactionId) -> KernelResult<()>;
    fn is_active(&self, txn_id: TransactionId) -> bool;
    fn snapshot_ts(&self, txn_id: TransactionId) -> KernelResult<u64>;
}
Expand description

Transaction operations

Provides ACID transaction semantics.

Required Methods§

Source

fn begin(&self) -> KernelResult<TransactionId>

Begin a new transaction

Source

fn begin_with_isolation( &self, isolation: IsolationLevel, ) -> KernelResult<TransactionId>

Begin a transaction with specific isolation level

Source

fn commit(&self, txn_id: TransactionId) -> KernelResult<()>

Commit a transaction

Source

fn abort(&self, txn_id: TransactionId) -> KernelResult<()>

Abort a transaction

Source

fn is_active(&self, txn_id: TransactionId) -> bool

Check if a transaction is active

Source

fn snapshot_ts(&self, txn_id: TransactionId) -> KernelResult<u64>

Get the snapshot timestamp for a transaction

Implementors§