Struct rocksdb::OptimisticTransactionOptions
source · pub struct OptimisticTransactionOptions { /* private fields */ }
Implementations§
source§impl OptimisticTransactionOptions
impl OptimisticTransactionOptions
pub fn new() -> OptimisticTransactionOptions
sourcepub fn set_snapshot(&mut self, snapshot: bool)
pub fn set_snapshot(&mut self, snapshot: bool)
Specifies use snapshot or not.
Default: false.
If a transaction has a snapshot set, the transaction will ensure that
any keys successfully written(or fetched via get_for_update
) have not
been modified outside the transaction since the time the snapshot was
set.
If a snapshot has not been set, the transaction guarantees that keys have
not been modified since the time each key was first written (or fetched via
get_for_update
).
Using snapshot will provide stricter isolation guarantees at the expense of potentially more transaction failures due to conflicts with other writes.
Calling set_snapshot
will not affect the version of Data returned by get
methods.