Struct exonum_rocksdb::transaction_db::transaction::TransactionOptions [] [src]

pub struct TransactionOptions { /* fields omitted */ }

Methods

impl TransactionOptions
[src]

[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);

[src]

[src]

[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);

[src]

[src]

Trait Implementations

impl Default for TransactionOptions
[src]

[src]

Returns the "default value" for a type. Read more

impl Drop for TransactionOptions
[src]

[src]

Executes the destructor for this type. Read more