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§
Sourcefn begin(&self) -> KernelResult<TransactionId>
fn begin(&self) -> KernelResult<TransactionId>
Begin a new transaction
Sourcefn begin_with_isolation(
&self,
isolation: IsolationLevel,
) -> KernelResult<TransactionId>
fn begin_with_isolation( &self, isolation: IsolationLevel, ) -> KernelResult<TransactionId>
Begin a transaction with specific isolation level
Sourcefn commit(&self, txn_id: TransactionId) -> KernelResult<()>
fn commit(&self, txn_id: TransactionId) -> KernelResult<()>
Commit a transaction
Sourcefn abort(&self, txn_id: TransactionId) -> KernelResult<()>
fn abort(&self, txn_id: TransactionId) -> KernelResult<()>
Abort a transaction
Sourcefn is_active(&self, txn_id: TransactionId) -> bool
fn is_active(&self, txn_id: TransactionId) -> bool
Check if a transaction is active
Sourcefn snapshot_ts(&self, txn_id: TransactionId) -> KernelResult<u64>
fn snapshot_ts(&self, txn_id: TransactionId) -> KernelResult<u64>
Get the snapshot timestamp for a transaction