Struct exonum_rocksdb::transaction_db::transaction::TransactionOptions
[−]
[src]
pub struct TransactionOptions { /* fields omitted */ }
Methods
impl TransactionOptions
[src]
fn set_snapshot(&mut self, v: bool)
[src]
If a transaction has a snapshot set, the transaction will ensure that any keys successfully written(or fetched have not been modified outside of this 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.
Using set_snapshot(true) will provide stricter isolation guarantees at the expense of potentially more transaction failures due to conflicts with other writes.
Calling set_snapshot(true) has no effect on keys written before this function has been called.
set_snapshot() may be called multiple times if you would like to change the snapshot used for different operations in this transaction.
Default: false
Example
use exonum_rocksdb::TransactionOptions; let mut opts = TransactionOptions::default(); opts.set_snapshot(true);
fn set_deadlock_detect(&mut self, v: bool)
[src]
fn set_lock_timeout(&mut self, lock_timeout: i64)
[src]
fn set_expiration(&mut self, expiration: i64)
[src]
Expiration duration in milliseconds. If non-negative, transactions that last longer than this many milliseconds will fail to commit. If not set, a forgotten transaction that is never committed, rolled back, or deleted will never relinquish any locks it holds. This could prevent keys from being written by other writers.
Defaul: -1
Example
use exonum_rocksdb::TransactionOptions; let mut opts = TransactionOptions::default(); opts.set_expiration(1000);
fn set_deadlock_detect_depth(&mut self, depth: i64)
[src]
fn set_max_write_batch_size(&mut self, size: usize)
[src]
Trait Implementations
impl Default for TransactionOptions
[src]
fn default() -> TransactionOptions
[src]
Returns the "default value" for a type. Read more