pub struct TransactionManager { /* private fields */ }Expand description
Transaction Manager (in-memory, no WAL durability)
Manages transaction lifecycle and provides ACID guarantees for in-memory operations. This implementation does NOT include WAL integration.
For production workloads requiring durability, use [sochdb_storage::MvccTransactionManager]
which includes:
- Write-ahead logging for crash recovery
- Serializable Snapshot Isolation (SSI)
- Group commit for high throughput
- Event-driven async architecture
Implementations§
Source§impl TransactionManager
impl TransactionManager
pub fn new() -> Self
Sourcepub fn begin(&self) -> Transaction
pub fn begin(&self) -> Transaction
Begin a new transaction
Sourcepub fn begin_with_isolation(&self, isolation: IsolationLevel) -> Transaction
pub fn begin_with_isolation(&self, isolation: IsolationLevel) -> Transaction
Begin a transaction with specific isolation level
Sourcepub fn get_commit_ts(&self) -> u64
pub fn get_commit_ts(&self) -> u64
Get commit timestamp
Sourcepub fn mark_committed(&self, txn: &mut Transaction)
pub fn mark_committed(&self, txn: &mut Transaction)
Mark transaction as committed
Sourcepub fn mark_aborted(&self, txn: &mut Transaction)
pub fn mark_aborted(&self, txn: &mut Transaction)
Mark transaction as aborted
Sourcepub fn mark_conflict_abort(&self, txn: &mut Transaction)
pub fn mark_conflict_abort(&self, txn: &mut Transaction)
Mark transaction as aborted due to conflict
Sourcepub fn oldest_active_ts(&self) -> u64
pub fn oldest_active_ts(&self) -> u64
Get the oldest active transaction timestamp
Sourcepub fn advance_watermark(&self, new_watermark: u64)
pub fn advance_watermark(&self, new_watermark: u64)
Update the committed watermark
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TransactionManager
impl !RefUnwindSafe for TransactionManager
impl Send for TransactionManager
impl Sync for TransactionManager
impl Unpin for TransactionManager
impl UnwindSafe for TransactionManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more